{"action":"created","comment":{"url":"https://api.github.com/repos/rails/actioncable/pulls/comments/47443320","id":47443320,"diff_hunk":"@@ -180,6 +180,11 @@ def allow_request_origin?\n           end\n         end\n \n+        def allowed_origins_match? origin\n+          allowed_origins = Array(server.config.allowed_request_origins)\n+          allowed_origins.any? { |allowed_origin| allowed_origin.is_a?(Regexp) ? allowed_origin =~ origin : allowed_origin == origin }","path":"lib/action_cable/connection/base.rb","position":15,"original_position":15,"commit_id":"09e10ef643f00c6b4c5877438ed50d2a5f199522","original_commit_id":"f674f2fda2af6271da15af4219c7f873d4d718c0","user":{"login":"lsylvester","id":191128,"avatar_url":"https://avatars.githubusercontent.com/u/191128?v=3","gravatar_id":"","url":"https://api.github.com/users/lsylvester","html_url":"https://github.com/lsylvester","followers_url":"https://api.github.com/users/lsylvester/followers","following_url":"https://api.github.com/users/lsylvester/following{/other_user}","gists_url":"https://api.github.com/users/lsylvester/gists{/gist_id}","starred_url":"https://api.github.com/users/lsylvester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsylvester/subscriptions","organizations_url":"https://api.github.com/users/lsylvester/orgs","repos_url":"https://api.github.com/users/lsylvester/repos","events_url":"https://api.github.com/users/lsylvester/events{/privacy}","received_events_url":"https://api.github.com/users/lsylvester/received_events","type":"User","site_admin":false},"body":"@adamliesko I don't think this method is used anymore and can be removed.","created_at":"2015-12-13T11:39:53Z","updated_at":"2015-12-13T11:39:53Z","html_url":"https://github.com/rails/actioncable/pull/130#discussion_r47443320","pull_request_url":"https://api.github.com/repos/rails/actioncable/pulls/130","_links":{"self":{"href":"https://api.github.com/repos/rails/actioncable/pulls/comments/47443320"},"html":{"href":"https://github.com/rails/actioncable/pull/130#discussion_r47443320"},"pull_request":{"href":"https://api.github.com/repos/rails/actioncable/pulls/130"}}},"pull_request":{"url":"https://api.github.com/repos/rails/actioncable/pulls/130","id":52766342,"html_url":"https://github.com/rails/actioncable/pull/130","diff_url":"https://github.com/rails/actioncable/pull/130.diff","patch_url":"https://github.com/rails/actioncable/pull/130.patch","issue_url":"https://api.github.com/repos/rails/actioncable/issues/130","number":130,"state":"open","locked":false,"title":"Allow regexp for a allowed_request_origins array","user":{"login":"adamliesko","id":1286236,"avatar_url":"https://avatars.githubusercontent.com/u/1286236?v=3","gravatar_id":"","url":"https://api.github.com/users/adamliesko","html_url":"https://github.com/adamliesko","followers_url":"https://api.github.com/users/adamliesko/followers","following_url":"https://api.github.com/users/adamliesko/following{/other_user}","gists_url":"https://api.github.com/users/adamliesko/gists{/gist_id}","starred_url":"https://api.github.com/users/adamliesko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamliesko/subscriptions","organizations_url":"https://api.github.com/users/adamliesko/orgs","repos_url":"https://api.github.com/users/adamliesko/repos","events_url":"https://api.github.com/users/adamliesko/events{/privacy}","received_events_url":"https://api.github.com/users/adamliesko/received_events","type":"User","site_admin":false},"body":"Adding the feature of additional regexp check for `allowed_origin_requests`instead of only strict equal comparation.\r\n\r\nFixes #130 ","created_at":"2015-12-05T22:16:04Z","updated_at":"2015-12-13T11:39:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e2d64fbbed4a24865d798484aa17df2d2e391ad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/actioncable/pulls/130/commits","review_comments_url":"https://api.github.com/repos/rails/actioncable/pulls/130/comments","review_comment_url":"https://api.github.com/repos/rails/actioncable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/actioncable/issues/130/comments","statuses_url":"https://api.github.com/repos/rails/actioncable/statuses/09e10ef643f00c6b4c5877438ed50d2a5f199522","head":{"label":"adamliesko:allow_regexps_allowed_origins","ref":"allow_regexps_allowed_origins","sha":"09e10ef643f00c6b4c5877438ed50d2a5f199522","user":{"login":"adamliesko","id":1286236,"avatar_url":"https://avatars.githubusercontent.com/u/1286236?v=3","gravatar_id":"","url":"https://api.github.com/users/adamliesko","html_url":"https://github.com/adamliesko","followers_url":"https://api.github.com/users/adamliesko/followers","following_url":"https://api.github.com/users/adamliesko/following{/other_user}","gists_url":"https://api.github.com/users/adamliesko/gists{/gist_id}","starred_url":"https://api.github.com/users/adamliesko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamliesko/subscriptions","organizations_url":"https://api.github.com/users/adamliesko/orgs","repos_url":"https://api.github.com/users/adamliesko/repos","events_url":"https://api.github.com/users/adamliesko/events{/privacy}","received_events_url":"https://api.github.com/users/adamliesko/received_events","type":"User","site_admin":false},"repo":{"id":47474089,"name":"actioncable","full_name":"adamliesko/actioncable","owner":{"login":"adamliesko","id":1286236,"avatar_url":"https://avatars.githubusercontent.com/u/1286236?v=3","gravatar_id":"","url":"https://api.github.com/users/adamliesko","html_url":"https://github.com/adamliesko","followers_url":"https://api.github.com/users/adamliesko/followers","following_url":"https://api.github.com/users/adamliesko/following{/other_user}","gists_url":"https://api.github.com/users/adamliesko/gists{/gist_id}","starred_url":"https://api.github.com/users/adamliesko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamliesko/subscriptions","organizations_url":"https://api.github.com/users/adamliesko/orgs","repos_url":"https://api.github.com/users/adamliesko/repos","events_url":"https://api.github.com/users/adamliesko/events{/privacy}","received_events_url":"https://api.github.com/users/adamliesko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adamliesko/actioncable","description":"Framework for real-time communication over websockets","fork":true,"url":"https://api.github.com/repos/adamliesko/actioncable","forks_url":"https://api.github.com/repos/adamliesko/actioncable/forks","keys_url":"https://api.github.com/repos/adamliesko/actioncable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamliesko/actioncable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamliesko/actioncable/teams","hooks_url":"https://api.github.com/repos/adamliesko/actioncable/hooks","issue_events_url":"https://api.github.com/repos/adamliesko/actioncable/issues/events{/number}","events_url":"https://api.github.com/repos/adamliesko/actioncable/events","assignees_url":"https://api.github.com/repos/adamliesko/actioncable/assignees{/user}","branches_url":"https://api.github.com/repos/adamliesko/actioncable/branches{/branch}","tags_url":"https://api.github.com/repos/adamliesko/actioncable/tags","blobs_url":"https://api.github.com/repos/adamliesko/actioncable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamliesko/actioncable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamliesko/actioncable/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamliesko/actioncable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamliesko/actioncable/statuses/{sha}","languages_url":"https://api.github.com/repos/adamliesko/actioncable/languages","stargazers_url":"https://api.github.com/repos/adamliesko/actioncable/stargazers","contributors_url":"https://api.github.com/repos/adamliesko/actioncable/contributors","subscribers_url":"https://api.github.com/repos/adamliesko/actioncable/subscribers","subscription_url":"https://api.github.com/repos/adamliesko/actioncable/subscription","commits_url":"https://api.github.com/repos/adamliesko/actioncable/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamliesko/actioncable/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamliesko/actioncable/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamliesko/actioncable/issues/comments{/number}","contents_url":"https://api.github.com/repos/adamliesko/actioncable/contents/{+path}","compare_url":"https://api.github.com/repos/adamliesko/actioncable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamliesko/actioncable/merges","archive_url":"https://api.github.com/repos/adamliesko/actioncable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamliesko/actioncable/downloads","issues_url":"https://api.github.com/repos/adamliesko/actioncable/issues{/number}","pulls_url":"https://api.github.com/repos/adamliesko/actioncable/pulls{/number}","milestones_url":"https://api.github.com/repos/adamliesko/actioncable/milestones{/number}","notifications_url":"https://api.github.com/repos/adamliesko/actioncable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamliesko/actioncable/labels{/name}","releases_url":"https://api.github.com/repos/adamliesko/actioncable/releases{/id}","created_at":"2015-12-05T21:52:14Z","updated_at":"2015-12-05T21:52:15Z","pushed_at":"2015-12-12T22:15:37Z","git_url":"git://github.com/adamliesko/actioncable.git","ssh_url":"git@github.com:adamliesko/actioncable.git","clone_url":"https://github.com/adamliesko/actioncable.git","svn_url":"https://github.com/adamliesko/actioncable","homepage":null,"size":359,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"c362beab2edd3dcae248dfaaaf3e0dee12baafa8","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":29253597,"name":"actioncable","full_name":"rails/actioncable","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/actioncable","description":"Framework for real-time communication over websockets","fork":false,"url":"https://api.github.com/repos/rails/actioncable","forks_url":"https://api.github.com/repos/rails/actioncable/forks","keys_url":"https://api.github.com/repos/rails/actioncable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/actioncable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/actioncable/teams","hooks_url":"https://api.github.com/repos/rails/actioncable/hooks","issue_events_url":"https://api.github.com/repos/rails/actioncable/issues/events{/number}","events_url":"https://api.github.com/repos/rails/actioncable/events","assignees_url":"https://api.github.com/repos/rails/actioncable/assignees{/user}","branches_url":"https://api.github.com/repos/rails/actioncable/branches{/branch}","tags_url":"https://api.github.com/repos/rails/actioncable/tags","blobs_url":"https://api.github.com/repos/rails/actioncable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/actioncable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/actioncable/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/actioncable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/actioncable/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/actioncable/languages","stargazers_url":"https://api.github.com/repos/rails/actioncable/stargazers","contributors_url":"https://api.github.com/repos/rails/actioncable/contributors","subscribers_url":"https://api.github.com/repos/rails/actioncable/subscribers","subscription_url":"https://api.github.com/repos/rails/actioncable/subscription","commits_url":"https://api.github.com/repos/rails/actioncable/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/actioncable/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/actioncable/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/actioncable/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/actioncable/contents/{+path}","compare_url":"https://api.github.com/repos/rails/actioncable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/actioncable/merges","archive_url":"https://api.github.com/repos/rails/actioncable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/actioncable/downloads","issues_url":"https://api.github.com/repos/rails/actioncable/issues{/number}","pulls_url":"https://api.github.com/repos/rails/actioncable/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/actioncable/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/actioncable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/actioncable/labels{/name}","releases_url":"https://api.github.com/repos/rails/actioncable/releases{/id}","created_at":"2015-01-14T16:27:07Z","updated_at":"2015-12-13T09:49:04Z","pushed_at":"2015-12-13T11:12:57Z","git_url":"git://github.com/rails/actioncable.git","ssh_url":"git@github.com:rails/actioncable.git","clone_url":"https://github.com/rails/actioncable.git","svn_url":"https://github.com/rails/actioncable","homepage":null,"size":450,"stargazers_count":1090,"watchers_count":1090,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":103,"mirror_url":null,"open_issues_count":20,"forks":103,"open_issues":20,"watchers":1090,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/actioncable/pulls/130"},"html":{"href":"https://github.com/rails/actioncable/pull/130"},"issue":{"href":"https://api.github.com/repos/rails/actioncable/issues/130"},"comments":{"href":"https://api.github.com/repos/rails/actioncable/issues/130/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/actioncable/pulls/130/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/actioncable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/actioncable/pulls/130/commits"},"statuses":{"href":"https://api.github.com/repos/rails/actioncable/statuses/09e10ef643f00c6b4c5877438ed50d2a5f199522"}}}}