{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/32111357","id":32111357,"diff_hunk":"@@ -13,15 +13,13 @@ module ActionDispatch\n   # located at `public/assets/application.js` if the file exists. If the file\n   # does not exist, a 404 \"File not Found\" response will be returned.\n   class FileHandler\n-    def initialize(root, cache_control, index = 'index')\n+    def initialize(root, index = 'index', headers: )","path":"actionpack/lib/action_dispatch/middleware/static.rb","position":16,"original_position":16,"commit_id":"89145679e8d33c3f99bb511bdab7e5bfcd319c8f","original_commit_id":"89145679e8d33c3f99bb511bdab7e5bfcd319c8f","user":{"login":"yuki24","id":386234,"avatar_url":"https://avatars.githubusercontent.com/u/386234?v=3","gravatar_id":"","url":"https://api.github.com/users/yuki24","html_url":"https://github.com/yuki24","followers_url":"https://api.github.com/users/yuki24/followers","following_url":"https://api.github.com/users/yuki24/following{/other_user}","gists_url":"https://api.github.com/users/yuki24/gists{/gist_id}","starred_url":"https://api.github.com/users/yuki24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuki24/subscriptions","organizations_url":"https://api.github.com/users/yuki24/orgs","repos_url":"https://api.github.com/users/yuki24/repos","events_url":"https://api.github.com/users/yuki24/events{/privacy}","received_events_url":"https://api.github.com/users/yuki24/received_events","type":"User","site_admin":false},"body":"Absolutely. See my comment above about it: https://github.com/rails/rails/pull/19135#discussion_r32110510","created_at":"2015-06-10T12:23:42Z","updated_at":"2015-06-10T12:23:42Z","html_url":"https://github.com/rails/rails/pull/19135#discussion_r32111357","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/19135","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/32111357"},"html":{"href":"https://github.com/rails/rails/pull/19135#discussion_r32111357"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/19135"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/19135","id":30233221,"html_url":"https://github.com/rails/rails/pull/19135","diff_url":"https://github.com/rails/rails/pull/19135.diff","patch_url":"https://github.com/rails/rails/pull/19135.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/19135","number":19135,"state":"open","locked":false,"title":"Add basic support for access control headers to ActionDispatch::Static","user":{"login":"yuki24","id":386234,"avatar_url":"https://avatars.githubusercontent.com/u/386234?v=3","gravatar_id":"","url":"https://api.github.com/users/yuki24","html_url":"https://github.com/yuki24","followers_url":"https://api.github.com/users/yuki24/followers","following_url":"https://api.github.com/users/yuki24/following{/other_user}","gists_url":"https://api.github.com/users/yuki24/gists{/gist_id}","starred_url":"https://api.github.com/users/yuki24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuki24/subscriptions","organizations_url":"https://api.github.com/users/yuki24/orgs","repos_url":"https://api.github.com/users/yuki24/repos","events_url":"https://api.github.com/users/yuki24/events{/privacy}","received_events_url":"https://api.github.com/users/yuki24/received_events","type":"User","site_admin":false},"body":"Now ActionDispatch::Static can accept access control headers such as `Access-Control-Allow-Origin`. These headers will be set as well as `Cache-Control` header when a response is delivered. Access control headers can be configured with `#config` in `config/application.rb` or `config/environments/***.rb`:\r\n\r\n```ruby\r\nconfig.action_dispatch.access_control_headers = {\r\n  \"Access-Control-Allow-Origin\"      => 'http://rubyonrails.org',\r\n  \"Access-Control-Expose-Headers\"    => 'X-Other-Custom-Header',\r\n  \"Access-Control-Allow-Headers\"     => 'X-Another-Custom-Header',\r\n  \"Access-Control-Max-Age\"           => '42',\r\n  \"Access-Control-Allow-Credentials\" => 'true',\r\n  \"Access-Control-Allow-Methods\"     => 'GET'\r\n}\r\n```\r\n\r\ncc/ @schneems ","created_at":"2015-02-28T23:30:46Z","updated_at":"2015-06-10T12:23:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e238d6f508b4933ea5286441f8978112c208753","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/19135/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/19135/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/19135/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/89145679e8d33c3f99bb511bdab7e5bfcd319c8f","head":{"label":"yuki24:access-control-support","ref":"access-control-support","sha":"89145679e8d33c3f99bb511bdab7e5bfcd319c8f","user":{"login":"yuki24","id":386234,"avatar_url":"https://avatars.githubusercontent.com/u/386234?v=3","gravatar_id":"","url":"https://api.github.com/users/yuki24","html_url":"https://github.com/yuki24","followers_url":"https://api.github.com/users/yuki24/followers","following_url":"https://api.github.com/users/yuki24/following{/other_user}","gists_url":"https://api.github.com/users/yuki24/gists{/gist_id}","starred_url":"https://api.github.com/users/yuki24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuki24/subscriptions","organizations_url":"https://api.github.com/users/yuki24/orgs","repos_url":"https://api.github.com/users/yuki24/repos","events_url":"https://api.github.com/users/yuki24/events{/privacy}","received_events_url":"https://api.github.com/users/yuki24/received_events","type":"User","site_admin":false},"repo":{"id":4546410,"name":"rails","full_name":"yuki24/rails","owner":{"login":"yuki24","id":386234,"avatar_url":"https://avatars.githubusercontent.com/u/386234?v=3","gravatar_id":"","url":"https://api.github.com/users/yuki24","html_url":"https://github.com/yuki24","followers_url":"https://api.github.com/users/yuki24/followers","following_url":"https://api.github.com/users/yuki24/following{/other_user}","gists_url":"https://api.github.com/users/yuki24/gists{/gist_id}","starred_url":"https://api.github.com/users/yuki24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuki24/subscriptions","organizations_url":"https://api.github.com/users/yuki24/orgs","repos_url":"https://api.github.com/users/yuki24/repos","events_url":"https://api.github.com/users/yuki24/events{/privacy}","received_events_url":"https://api.github.com/users/yuki24/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yuki24/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/yuki24/rails","forks_url":"https://api.github.com/repos/yuki24/rails/forks","keys_url":"https://api.github.com/repos/yuki24/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yuki24/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yuki24/rails/teams","hooks_url":"https://api.github.com/repos/yuki24/rails/hooks","issue_events_url":"https://api.github.com/repos/yuki24/rails/issues/events{/number}","events_url":"https://api.github.com/repos/yuki24/rails/events","assignees_url":"https://api.github.com/repos/yuki24/rails/assignees{/user}","branches_url":"https://api.github.com/repos/yuki24/rails/branches{/branch}","tags_url":"https://api.github.com/repos/yuki24/rails/tags","blobs_url":"https://api.github.com/repos/yuki24/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yuki24/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yuki24/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/yuki24/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yuki24/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/yuki24/rails/languages","stargazers_url":"https://api.github.com/repos/yuki24/rails/stargazers","contributors_url":"https://api.github.com/repos/yuki24/rails/contributors","subscribers_url":"https://api.github.com/repos/yuki24/rails/subscribers","subscription_url":"https://api.github.com/repos/yuki24/rails/subscription","commits_url":"https://api.github.com/repos/yuki24/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/yuki24/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/yuki24/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/yuki24/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/yuki24/rails/contents/{+path}","compare_url":"https://api.github.com/repos/yuki24/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yuki24/rails/merges","archive_url":"https://api.github.com/repos/yuki24/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yuki24/rails/downloads","issues_url":"https://api.github.com/repos/yuki24/rails/issues{/number}","pulls_url":"https://api.github.com/repos/yuki24/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/yuki24/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/yuki24/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yuki24/rails/labels{/name}","releases_url":"https://api.github.com/repos/yuki24/rails/releases{/id}","created_at":"2012-06-04T11:33:47Z","updated_at":"2015-04-13T01:40:48Z","pushed_at":"2015-06-10T12:18:36Z","git_url":"git://github.com/yuki24/rails.git","ssh_url":"git@github.com:yuki24/rails.git","clone_url":"https://github.com/yuki24/rails.git","svn_url":"https://github.com/yuki24/rails","homepage":"http://rubyonrails.org","size":141972,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"96bb004fc6e67cdf1b873f11ad5f8efd06949797","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","created_at":"2008-04-11T02:19:47Z","updated_at":"2015-06-10T11:19:50Z","pushed_at":"2015-06-10T12:18:49Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":417559,"stargazers_count":26466,"watchers_count":26466,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10531,"mirror_url":null,"open_issues_count":813,"forks":10531,"open_issues":813,"watchers":26466,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/19135"},"html":{"href":"https://github.com/rails/rails/pull/19135"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/19135"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/19135/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/19135/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/19135/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/89145679e8d33c3f99bb511bdab7e5bfcd319c8f"}}}}