{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/26651594","id":26651594,"diff_hunk":"@@ -24,7 +24,11 @@ def call(env)\n       def serve(req)\n         req.check_path_parameters!\n         uri = URI.parse(path(req.path_parameters, req))\n-        \n+\n+        if uri.opaque\n+          raise ArgumentError, \"redirect does not support opaque targets\"","path":"actionpack/lib/action_dispatch/routing/redirection.rb","position":7,"original_position":7,"commit_id":"7e9db6625b1aaa33b3fb6d3064d90ddf6dd4533f","original_commit_id":"7e9db6625b1aaa33b3fb6d3064d90ddf6dd4533f","user":{"login":"senny","id":5402,"avatar_url":"https://avatars.githubusercontent.com/u/5402?v=3","gravatar_id":"","url":"https://api.github.com/users/senny","html_url":"https://github.com/senny","followers_url":"https://api.github.com/users/senny/followers","following_url":"https://api.github.com/users/senny/following{/other_user}","gists_url":"https://api.github.com/users/senny/gists{/gist_id}","starred_url":"https://api.github.com/users/senny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/senny/subscriptions","organizations_url":"https://api.github.com/users/senny/orgs","repos_url":"https://api.github.com/users/senny/repos","events_url":"https://api.github.com/users/senny/events{/privacy}","received_events_url":"https://api.github.com/users/senny/received_events","type":"User","site_admin":false},"body":"Should we include `uri` in the error message to make it easier to figure out what's going on?","created_at":"2015-03-18T10:26:27Z","updated_at":"2015-03-18T10:26:27Z","html_url":"https://github.com/rails/rails/pull/16980#discussion_r26651594","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/16980","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/26651594"},"html":{"href":"https://github.com/rails/rails/pull/16980#discussion_r26651594"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/16980"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/16980","id":21513551,"html_url":"https://github.com/rails/rails/pull/16980","diff_url":"https://github.com/rails/rails/pull/16980.diff","patch_url":"https://github.com/rails/rails/pull/16980.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/16980","number":16980,"state":"open","locked":false,"title":"Fail informatively when redirect() is called with an opaque uri.","user":{"login":"Empact","id":5470,"avatar_url":"https://avatars.githubusercontent.com/u/5470?v=3","gravatar_id":"","url":"https://api.github.com/users/Empact","html_url":"https://github.com/Empact","followers_url":"https://api.github.com/users/Empact/followers","following_url":"https://api.github.com/users/Empact/following{/other_user}","gists_url":"https://api.github.com/users/Empact/gists{/gist_id}","starred_url":"https://api.github.com/users/Empact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Empact/subscriptions","organizations_url":"https://api.github.com/users/Empact/orgs","repos_url":"https://api.github.com/users/Empact/repos","events_url":"https://api.github.com/users/Empact/events{/privacy}","received_events_url":"https://api.github.com/users/Empact/received_events","type":"User","site_admin":false},"body":"Absent this fix the call fails at runtime with “undefined method `empty?' for nil:NilClass” for uri.path.empty? because opaque uris have no path.\r\n\r\nAlso split the redirection tests out of routing_test.rb, which is pretty beefy.","created_at":"2014-09-19T18:02:20Z","updated_at":"2015-03-18T10:26:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"52e75d41712ec061673ba6c7377ac9be1885cf41","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/16980/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/16980/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/16980/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/7e9db6625b1aaa33b3fb6d3064d90ddf6dd4533f","head":{"label":"Empact:redirect-opaque-failure","ref":"redirect-opaque-failure","sha":"7e9db6625b1aaa33b3fb6d3064d90ddf6dd4533f","user":{"login":"Empact","id":5470,"avatar_url":"https://avatars.githubusercontent.com/u/5470?v=3","gravatar_id":"","url":"https://api.github.com/users/Empact","html_url":"https://github.com/Empact","followers_url":"https://api.github.com/users/Empact/followers","following_url":"https://api.github.com/users/Empact/following{/other_user}","gists_url":"https://api.github.com/users/Empact/gists{/gist_id}","starred_url":"https://api.github.com/users/Empact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Empact/subscriptions","organizations_url":"https://api.github.com/users/Empact/orgs","repos_url":"https://api.github.com/users/Empact/repos","events_url":"https://api.github.com/users/Empact/events{/privacy}","received_events_url":"https://api.github.com/users/Empact/received_events","type":"User","site_admin":false},"repo":{"id":1558716,"name":"rails","full_name":"Empact/rails","owner":{"login":"Empact","id":5470,"avatar_url":"https://avatars.githubusercontent.com/u/5470?v=3","gravatar_id":"","url":"https://api.github.com/users/Empact","html_url":"https://github.com/Empact","followers_url":"https://api.github.com/users/Empact/followers","following_url":"https://api.github.com/users/Empact/following{/other_user}","gists_url":"https://api.github.com/users/Empact/gists{/gist_id}","starred_url":"https://api.github.com/users/Empact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Empact/subscriptions","organizations_url":"https://api.github.com/users/Empact/orgs","repos_url":"https://api.github.com/users/Empact/repos","events_url":"https://api.github.com/users/Empact/events{/privacy}","received_events_url":"https://api.github.com/users/Empact/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Empact/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/Empact/rails","forks_url":"https://api.github.com/repos/Empact/rails/forks","keys_url":"https://api.github.com/repos/Empact/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Empact/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Empact/rails/teams","hooks_url":"https://api.github.com/repos/Empact/rails/hooks","issue_events_url":"https://api.github.com/repos/Empact/rails/issues/events{/number}","events_url":"https://api.github.com/repos/Empact/rails/events","assignees_url":"https://api.github.com/repos/Empact/rails/assignees{/user}","branches_url":"https://api.github.com/repos/Empact/rails/branches{/branch}","tags_url":"https://api.github.com/repos/Empact/rails/tags","blobs_url":"https://api.github.com/repos/Empact/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Empact/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Empact/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/Empact/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Empact/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/Empact/rails/languages","stargazers_url":"https://api.github.com/repos/Empact/rails/stargazers","contributors_url":"https://api.github.com/repos/Empact/rails/contributors","subscribers_url":"https://api.github.com/repos/Empact/rails/subscribers","subscription_url":"https://api.github.com/repos/Empact/rails/subscription","commits_url":"https://api.github.com/repos/Empact/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/Empact/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/Empact/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/Empact/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/Empact/rails/contents/{+path}","compare_url":"https://api.github.com/repos/Empact/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Empact/rails/merges","archive_url":"https://api.github.com/repos/Empact/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Empact/rails/downloads","issues_url":"https://api.github.com/repos/Empact/rails/issues{/number}","pulls_url":"https://api.github.com/repos/Empact/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/Empact/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/Empact/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Empact/rails/labels{/name}","releases_url":"https://api.github.com/repos/Empact/rails/releases{/id}","created_at":"2011-04-02T06:19:39Z","updated_at":"2015-03-10T00:47:32Z","pushed_at":"2015-03-18T07:52:45Z","git_url":"git://github.com/Empact/rails.git","ssh_url":"git@github.com:Empact/rails.git","clone_url":"https://github.com/Empact/rails.git","svn_url":"https://github.com/Empact/rails","homepage":"http://rubyonrails.org","size":119070,"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":"3f39ac4ee8ea96dbd921b13485e1976c04733889","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-03-18T10:20:59Z","pushed_at":"2015-03-18T10:20:56Z","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":390514,"stargazers_count":25303,"watchers_count":25303,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9918,"mirror_url":null,"open_issues_count":724,"forks":9918,"open_issues":724,"watchers":25303,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/16980"},"html":{"href":"https://github.com/rails/rails/pull/16980"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/16980"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/16980/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/16980/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/16980/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/7e9db6625b1aaa33b3fb6d3064d90ddf6dd4533f"}}}}