{"action":"created","comment":{"url":"https://api.github.com/repos/josh/rails-behaviors/pulls/comments/25820067","id":25820067,"diff_hunk":"@@ -68,4 +68,12 @@ isSameOrigin = (url) ->\n   a = document.createElement 'a'\n   a.href = url\n   a.href = a.href\n+\n+  # Make sure that the browser parses out a protocol.\n+  a.protocol && origin.protocol &&","path":"csrf.coffee","position":6,"original_position":6,"commit_id":"06f95f2383acda535ac67a8618a7273d5197f385","original_commit_id":"06f95f2383acda535ac67a8618a7273d5197f385","user":{"login":"mastahyeti","id":1144197,"avatar_url":"https://avatars.githubusercontent.com/u/1144197?v=3","gravatar_id":"","url":"https://api.github.com/users/mastahyeti","html_url":"https://github.com/mastahyeti","followers_url":"https://api.github.com/users/mastahyeti/followers","following_url":"https://api.github.com/users/mastahyeti/following{/other_user}","gists_url":"https://api.github.com/users/mastahyeti/gists{/gist_id}","starred_url":"https://api.github.com/users/mastahyeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastahyeti/subscriptions","organizations_url":"https://api.github.com/users/mastahyeti/orgs","repos_url":"https://api.github.com/users/mastahyeti/repos","events_url":"https://api.github.com/users/mastahyeti/events{/privacy}","received_events_url":"https://api.github.com/users/mastahyeti/received_events","type":"User","site_admin":true},"body":"I see what you mean. I kind of like the explicitness of checking both, but I'm happy to remove the origin check if you'd like.","created_at":"2015-03-04T22:16:31Z","updated_at":"2015-03-04T22:16:31Z","html_url":"https://github.com/josh/rails-behaviors/pull/42#discussion_r25820067","pull_request_url":"https://api.github.com/repos/josh/rails-behaviors/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/josh/rails-behaviors/pulls/comments/25820067"},"html":{"href":"https://github.com/josh/rails-behaviors/pull/42#discussion_r25820067"},"pull_request":{"href":"https://api.github.com/repos/josh/rails-behaviors/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/josh/rails-behaviors/pulls/42","id":30491141,"html_url":"https://github.com/josh/rails-behaviors/pull/42","diff_url":"https://github.com/josh/rails-behaviors/pull/42.diff","patch_url":"https://github.com/josh/rails-behaviors/pull/42.patch","issue_url":"https://api.github.com/repos/josh/rails-behaviors/issues/42","number":42,"state":"open","locked":false,"title":"Make sure that browser is parsing urls correctly","user":{"login":"mastahyeti","id":1144197,"avatar_url":"https://avatars.githubusercontent.com/u/1144197?v=3","gravatar_id":"","url":"https://api.github.com/users/mastahyeti","html_url":"https://github.com/mastahyeti","followers_url":"https://api.github.com/users/mastahyeti/followers","following_url":"https://api.github.com/users/mastahyeti/following{/other_user}","gists_url":"https://api.github.com/users/mastahyeti/gists{/gist_id}","starred_url":"https://api.github.com/users/mastahyeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastahyeti/subscriptions","organizations_url":"https://api.github.com/users/mastahyeti/orgs","repos_url":"https://api.github.com/users/mastahyeti/repos","events_url":"https://api.github.com/users/mastahyeti/events{/privacy}","received_events_url":"https://api.github.com/users/mastahyeti/received_events","type":"User","site_admin":true},"body":"There is a bug where some browser will return a `\"\"` host for a malformed URL. This PR ensures that the URL is actually parsed.\r\n\r\n/cc @josh @mislav @ptoomey3 @gregose @oreoshake @ealf","created_at":"2015-03-04T18:30:36Z","updated_at":"2015-03-04T22:16:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a621035e8715b9629ab05854df6c147e5c73be6e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/josh/rails-behaviors/pulls/42/commits","review_comments_url":"https://api.github.com/repos/josh/rails-behaviors/pulls/42/comments","review_comment_url":"https://api.github.com/repos/josh/rails-behaviors/pulls/comments{/number}","comments_url":"https://api.github.com/repos/josh/rails-behaviors/issues/42/comments","statuses_url":"https://api.github.com/repos/josh/rails-behaviors/statuses/06f95f2383acda535ac67a8618a7273d5197f385","head":{"label":"mastahyeti:bad_anchors","ref":"bad_anchors","sha":"06f95f2383acda535ac67a8618a7273d5197f385","user":{"login":"mastahyeti","id":1144197,"avatar_url":"https://avatars.githubusercontent.com/u/1144197?v=3","gravatar_id":"","url":"https://api.github.com/users/mastahyeti","html_url":"https://github.com/mastahyeti","followers_url":"https://api.github.com/users/mastahyeti/followers","following_url":"https://api.github.com/users/mastahyeti/following{/other_user}","gists_url":"https://api.github.com/users/mastahyeti/gists{/gist_id}","starred_url":"https://api.github.com/users/mastahyeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastahyeti/subscriptions","organizations_url":"https://api.github.com/users/mastahyeti/orgs","repos_url":"https://api.github.com/users/mastahyeti/repos","events_url":"https://api.github.com/users/mastahyeti/events{/privacy}","received_events_url":"https://api.github.com/users/mastahyeti/received_events","type":"User","site_admin":true},"repo":{"id":27839956,"name":"rails-behaviors","full_name":"mastahyeti/rails-behaviors","owner":{"login":"mastahyeti","id":1144197,"avatar_url":"https://avatars.githubusercontent.com/u/1144197?v=3","gravatar_id":"","url":"https://api.github.com/users/mastahyeti","html_url":"https://github.com/mastahyeti","followers_url":"https://api.github.com/users/mastahyeti/followers","following_url":"https://api.github.com/users/mastahyeti/following{/other_user}","gists_url":"https://api.github.com/users/mastahyeti/gists{/gist_id}","starred_url":"https://api.github.com/users/mastahyeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastahyeti/subscriptions","organizations_url":"https://api.github.com/users/mastahyeti/orgs","repos_url":"https://api.github.com/users/mastahyeti/repos","events_url":"https://api.github.com/users/mastahyeti/events{/privacy}","received_events_url":"https://api.github.com/users/mastahyeti/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/mastahyeti/rails-behaviors","description":"Rails UJS Behaviors for jQuery and Zepto","fork":true,"url":"https://api.github.com/repos/mastahyeti/rails-behaviors","forks_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/forks","keys_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/teams","hooks_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/hooks","issue_events_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/issues/events{/number}","events_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/events","assignees_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/assignees{/user}","branches_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/branches{/branch}","tags_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/tags","blobs_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/git/refs{/sha}","trees_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/statuses/{sha}","languages_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/languages","stargazers_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/stargazers","contributors_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/contributors","subscribers_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/subscribers","subscription_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/subscription","commits_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/commits{/sha}","git_commits_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/git/commits{/sha}","comments_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/comments{/number}","issue_comment_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/issues/comments{/number}","contents_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/contents/{+path}","compare_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/merges","archive_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/downloads","issues_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/issues{/number}","pulls_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/pulls{/number}","milestones_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/milestones{/number}","notifications_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/labels{/name}","releases_url":"https://api.github.com/repos/mastahyeti/rails-behaviors/releases{/id}","created_at":"2014-12-10T21:12:09Z","updated_at":"2014-12-10T21:12:09Z","pushed_at":"2015-03-04T21:00:58Z","git_url":"git://github.com/mastahyeti/rails-behaviors.git","ssh_url":"git@github.com:mastahyeti/rails-behaviors.git","clone_url":"https://github.com/mastahyeti/rails-behaviors.git","svn_url":"https://github.com/mastahyeti/rails-behaviors","homepage":"http://josh.github.com/rails-behaviors/","size":782,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"josh:master","ref":"master","sha":"2ec157f68041e508be6a22b20a4bad7648324daf","user":{"login":"josh","id":137,"avatar_url":"https://avatars.githubusercontent.com/u/137?v=3","gravatar_id":"","url":"https://api.github.com/users/josh","html_url":"https://github.com/josh","followers_url":"https://api.github.com/users/josh/followers","following_url":"https://api.github.com/users/josh/following{/other_user}","gists_url":"https://api.github.com/users/josh/gists{/gist_id}","starred_url":"https://api.github.com/users/josh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josh/subscriptions","organizations_url":"https://api.github.com/users/josh/orgs","repos_url":"https://api.github.com/users/josh/repos","events_url":"https://api.github.com/users/josh/events{/privacy}","received_events_url":"https://api.github.com/users/josh/received_events","type":"User","site_admin":true},"repo":{"id":2654975,"name":"rails-behaviors","full_name":"josh/rails-behaviors","owner":{"login":"josh","id":137,"avatar_url":"https://avatars.githubusercontent.com/u/137?v=3","gravatar_id":"","url":"https://api.github.com/users/josh","html_url":"https://github.com/josh","followers_url":"https://api.github.com/users/josh/followers","following_url":"https://api.github.com/users/josh/following{/other_user}","gists_url":"https://api.github.com/users/josh/gists{/gist_id}","starred_url":"https://api.github.com/users/josh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josh/subscriptions","organizations_url":"https://api.github.com/users/josh/orgs","repos_url":"https://api.github.com/users/josh/repos","events_url":"https://api.github.com/users/josh/events{/privacy}","received_events_url":"https://api.github.com/users/josh/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/josh/rails-behaviors","description":"Rails UJS Behaviors for jQuery and Zepto","fork":false,"url":"https://api.github.com/repos/josh/rails-behaviors","forks_url":"https://api.github.com/repos/josh/rails-behaviors/forks","keys_url":"https://api.github.com/repos/josh/rails-behaviors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/josh/rails-behaviors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/josh/rails-behaviors/teams","hooks_url":"https://api.github.com/repos/josh/rails-behaviors/hooks","issue_events_url":"https://api.github.com/repos/josh/rails-behaviors/issues/events{/number}","events_url":"https://api.github.com/repos/josh/rails-behaviors/events","assignees_url":"https://api.github.com/repos/josh/rails-behaviors/assignees{/user}","branches_url":"https://api.github.com/repos/josh/rails-behaviors/branches{/branch}","tags_url":"https://api.github.com/repos/josh/rails-behaviors/tags","blobs_url":"https://api.github.com/repos/josh/rails-behaviors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/josh/rails-behaviors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/josh/rails-behaviors/git/refs{/sha}","trees_url":"https://api.github.com/repos/josh/rails-behaviors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/josh/rails-behaviors/statuses/{sha}","languages_url":"https://api.github.com/repos/josh/rails-behaviors/languages","stargazers_url":"https://api.github.com/repos/josh/rails-behaviors/stargazers","contributors_url":"https://api.github.com/repos/josh/rails-behaviors/contributors","subscribers_url":"https://api.github.com/repos/josh/rails-behaviors/subscribers","subscription_url":"https://api.github.com/repos/josh/rails-behaviors/subscription","commits_url":"https://api.github.com/repos/josh/rails-behaviors/commits{/sha}","git_commits_url":"https://api.github.com/repos/josh/rails-behaviors/git/commits{/sha}","comments_url":"https://api.github.com/repos/josh/rails-behaviors/comments{/number}","issue_comment_url":"https://api.github.com/repos/josh/rails-behaviors/issues/comments{/number}","contents_url":"https://api.github.com/repos/josh/rails-behaviors/contents/{+path}","compare_url":"https://api.github.com/repos/josh/rails-behaviors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/josh/rails-behaviors/merges","archive_url":"https://api.github.com/repos/josh/rails-behaviors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/josh/rails-behaviors/downloads","issues_url":"https://api.github.com/repos/josh/rails-behaviors/issues{/number}","pulls_url":"https://api.github.com/repos/josh/rails-behaviors/pulls{/number}","milestones_url":"https://api.github.com/repos/josh/rails-behaviors/milestones{/number}","notifications_url":"https://api.github.com/repos/josh/rails-behaviors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/josh/rails-behaviors/labels{/name}","releases_url":"https://api.github.com/repos/josh/rails-behaviors/releases{/id}","created_at":"2011-10-27T00:38:48Z","updated_at":"2015-03-03T20:45:43Z","pushed_at":"2015-03-03T20:45:43Z","git_url":"git://github.com/josh/rails-behaviors.git","ssh_url":"git@github.com:josh/rails-behaviors.git","clone_url":"https://github.com/josh/rails-behaviors.git","svn_url":"https://github.com/josh/rails-behaviors","homepage":"http://josh.github.com/rails-behaviors/","size":918,"stargazers_count":276,"watchers_count":276,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":3,"forks":16,"open_issues":3,"watchers":276,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/josh/rails-behaviors/pulls/42"},"html":{"href":"https://github.com/josh/rails-behaviors/pull/42"},"issue":{"href":"https://api.github.com/repos/josh/rails-behaviors/issues/42"},"comments":{"href":"https://api.github.com/repos/josh/rails-behaviors/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/josh/rails-behaviors/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/josh/rails-behaviors/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/josh/rails-behaviors/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/josh/rails-behaviors/statuses/06f95f2383acda535ac67a8618a7273d5197f385"}}}}