{"action":"created","comment":{"url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/comments/63468407","id":63468407,"diff_hunk":"@@ -44,6 +43,18 @@ class Server < Sinatra::Base\n       ZendeskAppsSupport::Installed.new([app_js], [installation]).compile_js\n     end\n \n+    get \"/:file\" do |file|\n+      access_control_allow_origin\n+      send_file File.join(settings.root, 'assets', file)","path":"lib/zendesk_apps_tools/server.rb","position":14,"original_position":14,"commit_id":"05f0c5e5cd6b7943f59af5acda9485b6e268d501","original_commit_id":"05f0c5e5cd6b7943f59af5acda9485b6e268d501","user":{"login":"ocke","id":5171412,"avatar_url":"https://avatars.githubusercontent.com/u/5171412?v=3","gravatar_id":"","url":"https://api.github.com/users/ocke","html_url":"https://github.com/ocke","followers_url":"https://api.github.com/users/ocke/followers","following_url":"https://api.github.com/users/ocke/following{/other_user}","gists_url":"https://api.github.com/users/ocke/gists{/gist_id}","starred_url":"https://api.github.com/users/ocke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocke/subscriptions","organizations_url":"https://api.github.com/users/ocke/orgs","repos_url":"https://api.github.com/users/ocke/repos","events_url":"https://api.github.com/users/ocke/events{/privacy}","received_events_url":"https://api.github.com/users/ocke/received_events","type":"User","site_admin":false},"body":"noted. what happens with files if i upload something in that order? they get lost? or it gets flattened?\r\n\r\nAlso can you do ../../../../../etc/hosts with this style?","created_at":"2016-05-17T06:02:39Z","updated_at":"2016-05-17T06:02:39Z","html_url":"https://github.com/zendesk/zendesk_apps_tools/pull/127#discussion_r63468407","pull_request_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/127","_links":{"self":{"href":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/comments/63468407"},"html":{"href":"https://github.com/zendesk/zendesk_apps_tools/pull/127#discussion_r63468407"},"pull_request":{"href":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/127","id":70301895,"html_url":"https://github.com/zendesk/zendesk_apps_tools/pull/127","diff_url":"https://github.com/zendesk/zendesk_apps_tools/pull/127.diff","patch_url":"https://github.com/zendesk/zendesk_apps_tools/pull/127.patch","issue_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/issues/127","number":127,"state":"open","locked":false,"title":"Satisfy preflight requests","user":{"login":"ocke","id":5171412,"avatar_url":"https://avatars.githubusercontent.com/u/5171412?v=3","gravatar_id":"","url":"https://api.github.com/users/ocke","html_url":"https://github.com/ocke","followers_url":"https://api.github.com/users/ocke/followers","following_url":"https://api.github.com/users/ocke/following{/other_user}","gists_url":"https://api.github.com/users/ocke/gists{/gist_id}","starred_url":"https://api.github.com/users/ocke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocke/subscriptions","organizations_url":"https://api.github.com/users/ocke/orgs","repos_url":"https://api.github.com/users/ocke/repos","events_url":"https://api.github.com/users/ocke/events{/privacy}","received_events_url":"https://api.github.com/users/ocke/received_events","type":"User","site_admin":false},"body":":v:\r\n\r\n/cc @zendesk/vegemite\r\n\r\n### Description\r\nBrowsers turn out to be draconian when it comes to getting anything else than an images or a javascript file.\r\n\r\nTurns out 2 headers were added which makes this a CORS request with a preflight where we need to allow those headers\r\n\r\nThis PR satisfies all that, so i can load a .txt or .json file from my assets folder.\r\n\r\n### References\r\n* JIRA: \r\n\r\n### Risks","created_at":"2016-05-17T05:32:11Z","updated_at":"2016-05-17T06:02:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"359c049228a88e95f3c7c7795e6b036187afeaad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/127/commits","review_comments_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/127/comments","review_comment_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/issues/127/comments","statuses_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/statuses/05f0c5e5cd6b7943f59af5acda9485b6e268d501","head":{"label":"zendesk:olaf/local_assets","ref":"olaf/local_assets","sha":"05f0c5e5cd6b7943f59af5acda9485b6e268d501","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":6392706,"name":"zendesk_apps_tools","full_name":"zendesk/zendesk_apps_tools","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/zendesk_apps_tools","description":"","fork":false,"url":"https://api.github.com/repos/zendesk/zendesk_apps_tools","forks_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/forks","keys_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/teams","hooks_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/hooks","issue_events_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/events","assignees_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/tags","blobs_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/languages","stargazers_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/stargazers","contributors_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/contributors","subscribers_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/subscribers","subscription_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/subscription","commits_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/merges","archive_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/downloads","issues_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/deployments","created_at":"2012-10-25T18:57:26Z","updated_at":"2016-02-29T08:35:02Z","pushed_at":"2016-05-17T05:32:11Z","git_url":"git://github.com/zendesk/zendesk_apps_tools.git","ssh_url":"git@github.com:zendesk/zendesk_apps_tools.git","clone_url":"https://github.com/zendesk/zendesk_apps_tools.git","svn_url":"https://github.com/zendesk/zendesk_apps_tools","homepage":null,"size":863,"stargazers_count":14,"watchers_count":14,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":8,"forks":10,"open_issues":8,"watchers":14,"default_branch":"master"}},"base":{"label":"zendesk:master","ref":"master","sha":"77cb258bedcc9624adbabb0de8008d1dd7007ef0","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":6392706,"name":"zendesk_apps_tools","full_name":"zendesk/zendesk_apps_tools","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/zendesk_apps_tools","description":"","fork":false,"url":"https://api.github.com/repos/zendesk/zendesk_apps_tools","forks_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/forks","keys_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/teams","hooks_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/hooks","issue_events_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/events","assignees_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/tags","blobs_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/languages","stargazers_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/stargazers","contributors_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/contributors","subscribers_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/subscribers","subscription_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/subscription","commits_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/merges","archive_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/downloads","issues_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/zendesk_apps_tools/deployments","created_at":"2012-10-25T18:57:26Z","updated_at":"2016-02-29T08:35:02Z","pushed_at":"2016-05-17T05:32:11Z","git_url":"git://github.com/zendesk/zendesk_apps_tools.git","ssh_url":"git@github.com:zendesk/zendesk_apps_tools.git","clone_url":"https://github.com/zendesk/zendesk_apps_tools.git","svn_url":"https://github.com/zendesk/zendesk_apps_tools","homepage":null,"size":863,"stargazers_count":14,"watchers_count":14,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":8,"forks":10,"open_issues":8,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/127"},"html":{"href":"https://github.com/zendesk/zendesk_apps_tools/pull/127"},"issue":{"href":"https://api.github.com/repos/zendesk/zendesk_apps_tools/issues/127"},"comments":{"href":"https://api.github.com/repos/zendesk/zendesk_apps_tools/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendesk/zendesk_apps_tools/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/zendesk/zendesk_apps_tools/statuses/05f0c5e5cd6b7943f59af5acda9485b6e268d501"}}}}