{"action":"opened","number":432,"pull_request":{"url":"https://api.github.com/repos/brave/brave-core/pulls/432","id":214763644,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0NzYzNjQ0","html_url":"https://github.com/brave/brave-core/pull/432","diff_url":"https://github.com/brave/brave-core/pull/432.diff","patch_url":"https://github.com/brave/brave-core/pull/432.patch","issue_url":"https://api.github.com/repos/brave/brave-core/issues/432","number":432,"state":"open","locked":false,"title":"Pass origin and hostname for torrent.createServer","user":{"login":"yrliou","id":4730197,"node_id":"MDQ6VXNlcjQ3MzAxOTc=","avatar_url":"https://avatars1.githubusercontent.com/u/4730197?v=4","gravatar_id":"","url":"https://api.github.com/users/yrliou","html_url":"https://github.com/yrliou","followers_url":"https://api.github.com/users/yrliou/followers","following_url":"https://api.github.com/users/yrliou/following{/other_user}","gists_url":"https://api.github.com/users/yrliou/gists{/gist_id}","starred_url":"https://api.github.com/users/yrliou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yrliou/subscriptions","organizations_url":"https://api.github.com/users/yrliou/orgs","repos_url":"https://api.github.com/users/yrliou/repos","events_url":"https://api.github.com/users/yrliou/events{/privacy}","received_events_url":"https://api.github.com/users/yrliou/received_events","type":"User","site_admin":false},"body":"Fix https://github.com/brave/brave-browser/issues/1085\r\n## Submitter Checklist:\r\n\r\n- [x] Submitted a [ticket](https://github.com/brave/brave-browser/issues) for my issue if one did not already exist.\r\n- [x] Used Github [auto-closing keywords](https://help.github.com/articles/closing-issues-via-commit-messages/) in the commit message.\r\n- [ ] Added/updated tests for this change (for new code or code which already has tests).\r\n- [ ] Ran `git rebase -i` to squash commits (if needed).\r\n- [x] Tagged reviewers and labelled the pull request as needed.\r\n- [ ] Request a security/privacy review as needed.\r\n- [ ] Add appropriate QA labels (QA/Needed or QA/No-QA-Needed) to include the closed issue in milestone \r\n\r\n## Test Plan:\r\nOriginal test steps are from https://github.com/webtorrent/webtorrent/pull/1260#issuecomment-357169944\r\n\r\n- origin arg\r\n1. Start a torrent download by visiting https://webtorrent.io/torrents/sintel.torrent and check the port the local http server is using by hover over the save file links.\r\n\r\n2. Serve the following HTML file on a localhost server and then load it in your browser:\r\n```\r\n<div id='result'></div>\r\n<script>\r\n    const PORT = $PORT // replace this with $PORT number from step 1\r\n    const serverUrl = `http://localhost:${PORT}/0`\r\n    fetch(serverUrl).then((response) => {\r\n      response.text().then((text) => result.innerText = text)\r\n    })\r\n</script>\r\n```\r\n3.  The page should not load any texts from the torrent file.\r\n\r\n- hostname arg\r\nA bit tricky because right now since I manually remove the origin arg and rebuilt to check this argument alone.\r\nAdd a record `127.0.0.1 evil.localhost` in /etc/hosts.\r\nTake the same steps from origin arg, but modify serverUrl to `http://evil.localhost:${PORT}/0` and make sure the page won't load texts from the torrent file.\r\n\r\n## Reviewer Checklist:\r\n\r\n- [ ] New files have MPL-2.0 license header.\r\n- [ ] Request a security/privacy review as needed.\r\n- [ ] Adequate test coverage exists to prevent regressions \r\n- [ ] Verify test plan is specified in PR before merging to source","created_at":"2018-09-11T20:55:07Z","updated_at":"2018-09-11T20:55:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"yrliou","id":4730197,"node_id":"MDQ6VXNlcjQ3MzAxOTc=","avatar_url":"https://avatars1.githubusercontent.com/u/4730197?v=4","gravatar_id":"","url":"https://api.github.com/users/yrliou","html_url":"https://github.com/yrliou","followers_url":"https://api.github.com/users/yrliou/followers","following_url":"https://api.github.com/users/yrliou/following{/other_user}","gists_url":"https://api.github.com/users/yrliou/gists{/gist_id}","starred_url":"https://api.github.com/users/yrliou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yrliou/subscriptions","organizations_url":"https://api.github.com/users/yrliou/orgs","repos_url":"https://api.github.com/users/yrliou/repos","events_url":"https://api.github.com/users/yrliou/events{/privacy}","received_events_url":"https://api.github.com/users/yrliou/received_events","type":"User","site_admin":false},"assignees":[{"login":"yrliou","id":4730197,"node_id":"MDQ6VXNlcjQ3MzAxOTc=","avatar_url":"https://avatars1.githubusercontent.com/u/4730197?v=4","gravatar_id":"","url":"https://api.github.com/users/yrliou","html_url":"https://github.com/yrliou","followers_url":"https://api.github.com/users/yrliou/followers","following_url":"https://api.github.com/users/yrliou/following{/other_user}","gists_url":"https://api.github.com/users/yrliou/gists{/gist_id}","starred_url":"https://api.github.com/users/yrliou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yrliou/subscriptions","organizations_url":"https://api.github.com/users/yrliou/orgs","repos_url":"https://api.github.com/users/yrliou/repos","events_url":"https://api.github.com/users/yrliou/events{/privacy}","received_events_url":"https://api.github.com/users/yrliou/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/brave/brave-core/pulls/432/commits","review_comments_url":"https://api.github.com/repos/brave/brave-core/pulls/432/comments","review_comment_url":"https://api.github.com/repos/brave/brave-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brave/brave-core/issues/432/comments","statuses_url":"https://api.github.com/repos/brave/brave-core/statuses/2d372315340c9efdb323a4931df32246e46b184e","head":{"label":"brave:create_server_sec","ref":"create_server_sec","sha":"2d372315340c9efdb323a4931df32246e46b184e","user":{"login":"brave","id":12301619,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzAxNjE5","avatar_url":"https://avatars1.githubusercontent.com/u/12301619?v=4","gravatar_id":"","url":"https://api.github.com/users/brave","html_url":"https://github.com/brave","followers_url":"https://api.github.com/users/brave/followers","following_url":"https://api.github.com/users/brave/following{/other_user}","gists_url":"https://api.github.com/users/brave/gists{/gist_id}","starred_url":"https://api.github.com/users/brave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brave/subscriptions","organizations_url":"https://api.github.com/users/brave/orgs","repos_url":"https://api.github.com/users/brave/repos","events_url":"https://api.github.com/users/brave/events{/privacy}","received_events_url":"https://api.github.com/users/brave/received_events","type":"Organization","site_admin":false},"repo":{"id":110198384,"node_id":"MDEwOlJlcG9zaXRvcnkxMTAxOTgzODQ=","name":"brave-core","full_name":"brave/brave-core","owner":{"login":"brave","id":12301619,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzAxNjE5","avatar_url":"https://avatars1.githubusercontent.com/u/12301619?v=4","gravatar_id":"","url":"https://api.github.com/users/brave","html_url":"https://github.com/brave","followers_url":"https://api.github.com/users/brave/followers","following_url":"https://api.github.com/users/brave/following{/other_user}","gists_url":"https://api.github.com/users/brave/gists{/gist_id}","starred_url":"https://api.github.com/users/brave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brave/subscriptions","organizations_url":"https://api.github.com/users/brave/orgs","repos_url":"https://api.github.com/users/brave/repos","events_url":"https://api.github.com/users/brave/events{/privacy}","received_events_url":"https://api.github.com/users/brave/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brave/brave-core","description":"Core engine for the Brave browser for macOS, Windows, Linux, and eventually Android. For the issue log, please see https://github.com/brave/brave-browser","fork":false,"url":"https://api.github.com/repos/brave/brave-core","forks_url":"https://api.github.com/repos/brave/brave-core/forks","keys_url":"https://api.github.com/repos/brave/brave-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brave/brave-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brave/brave-core/teams","hooks_url":"https://api.github.com/repos/brave/brave-core/hooks","issue_events_url":"https://api.github.com/repos/brave/brave-core/issues/events{/number}","events_url":"https://api.github.com/repos/brave/brave-core/events","assignees_url":"https://api.github.com/repos/brave/brave-core/assignees{/user}","branches_url":"https://api.github.com/repos/brave/brave-core/branches{/branch}","tags_url":"https://api.github.com/repos/brave/brave-core/tags","blobs_url":"https://api.github.com/repos/brave/brave-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brave/brave-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brave/brave-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/brave/brave-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brave/brave-core/statuses/{sha}","languages_url":"https://api.github.com/repos/brave/brave-core/languages","stargazers_url":"https://api.github.com/repos/brave/brave-core/stargazers","contributors_url":"https://api.github.com/repos/brave/brave-core/contributors","subscribers_url":"https://api.github.com/repos/brave/brave-core/subscribers","subscription_url":"https://api.github.com/repos/brave/brave-core/subscription","commits_url":"https://api.github.com/repos/brave/brave-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/brave/brave-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/brave/brave-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/brave/brave-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/brave/brave-core/contents/{+path}","compare_url":"https://api.github.com/repos/brave/brave-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brave/brave-core/merges","archive_url":"https://api.github.com/repos/brave/brave-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brave/brave-core/downloads","issues_url":"https://api.github.com/repos/brave/brave-core/issues{/number}","pulls_url":"https://api.github.com/repos/brave/brave-core/pulls{/number}","milestones_url":"https://api.github.com/repos/brave/brave-core/milestones{/number}","notifications_url":"https://api.github.com/repos/brave/brave-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brave/brave-core/labels{/name}","releases_url":"https://api.github.com/repos/brave/brave-core/releases{/id}","deployments_url":"https://api.github.com/repos/brave/brave-core/deployments","created_at":"2017-11-10T03:33:30Z","updated_at":"2018-09-11T16:11:58Z","pushed_at":"2018-09-11T20:41:57Z","git_url":"git://github.com/brave/brave-core.git","ssh_url":"git@github.com:brave/brave-core.git","clone_url":"https://github.com/brave/brave-core.git","svn_url":"https://github.com/brave/brave-core","homepage":"","size":44194,"stargazers_count":122,"watchers_count":122,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":33,"open_issues":12,"watchers":122,"default_branch":"master"}},"base":{"label":"brave:master","ref":"master","sha":"3bac438074bd601f7508daf10fc297bef6d21034","user":{"login":"brave","id":12301619,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzAxNjE5","avatar_url":"https://avatars1.githubusercontent.com/u/12301619?v=4","gravatar_id":"","url":"https://api.github.com/users/brave","html_url":"https://github.com/brave","followers_url":"https://api.github.com/users/brave/followers","following_url":"https://api.github.com/users/brave/following{/other_user}","gists_url":"https://api.github.com/users/brave/gists{/gist_id}","starred_url":"https://api.github.com/users/brave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brave/subscriptions","organizations_url":"https://api.github.com/users/brave/orgs","repos_url":"https://api.github.com/users/brave/repos","events_url":"https://api.github.com/users/brave/events{/privacy}","received_events_url":"https://api.github.com/users/brave/received_events","type":"Organization","site_admin":false},"repo":{"id":110198384,"node_id":"MDEwOlJlcG9zaXRvcnkxMTAxOTgzODQ=","name":"brave-core","full_name":"brave/brave-core","owner":{"login":"brave","id":12301619,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzAxNjE5","avatar_url":"https://avatars1.githubusercontent.com/u/12301619?v=4","gravatar_id":"","url":"https://api.github.com/users/brave","html_url":"https://github.com/brave","followers_url":"https://api.github.com/users/brave/followers","following_url":"https://api.github.com/users/brave/following{/other_user}","gists_url":"https://api.github.com/users/brave/gists{/gist_id}","starred_url":"https://api.github.com/users/brave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brave/subscriptions","organizations_url":"https://api.github.com/users/brave/orgs","repos_url":"https://api.github.com/users/brave/repos","events_url":"https://api.github.com/users/brave/events{/privacy}","received_events_url":"https://api.github.com/users/brave/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brave/brave-core","description":"Core engine for the Brave browser for macOS, Windows, Linux, and eventually Android. For the issue log, please see https://github.com/brave/brave-browser","fork":false,"url":"https://api.github.com/repos/brave/brave-core","forks_url":"https://api.github.com/repos/brave/brave-core/forks","keys_url":"https://api.github.com/repos/brave/brave-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brave/brave-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brave/brave-core/teams","hooks_url":"https://api.github.com/repos/brave/brave-core/hooks","issue_events_url":"https://api.github.com/repos/brave/brave-core/issues/events{/number}","events_url":"https://api.github.com/repos/brave/brave-core/events","assignees_url":"https://api.github.com/repos/brave/brave-core/assignees{/user}","branches_url":"https://api.github.com/repos/brave/brave-core/branches{/branch}","tags_url":"https://api.github.com/repos/brave/brave-core/tags","blobs_url":"https://api.github.com/repos/brave/brave-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brave/brave-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brave/brave-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/brave/brave-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brave/brave-core/statuses/{sha}","languages_url":"https://api.github.com/repos/brave/brave-core/languages","stargazers_url":"https://api.github.com/repos/brave/brave-core/stargazers","contributors_url":"https://api.github.com/repos/brave/brave-core/contributors","subscribers_url":"https://api.github.com/repos/brave/brave-core/subscribers","subscription_url":"https://api.github.com/repos/brave/brave-core/subscription","commits_url":"https://api.github.com/repos/brave/brave-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/brave/brave-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/brave/brave-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/brave/brave-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/brave/brave-core/contents/{+path}","compare_url":"https://api.github.com/repos/brave/brave-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brave/brave-core/merges","archive_url":"https://api.github.com/repos/brave/brave-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brave/brave-core/downloads","issues_url":"https://api.github.com/repos/brave/brave-core/issues{/number}","pulls_url":"https://api.github.com/repos/brave/brave-core/pulls{/number}","milestones_url":"https://api.github.com/repos/brave/brave-core/milestones{/number}","notifications_url":"https://api.github.com/repos/brave/brave-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brave/brave-core/labels{/name}","releases_url":"https://api.github.com/repos/brave/brave-core/releases{/id}","deployments_url":"https://api.github.com/repos/brave/brave-core/deployments","created_at":"2017-11-10T03:33:30Z","updated_at":"2018-09-11T16:11:58Z","pushed_at":"2018-09-11T20:41:57Z","git_url":"git://github.com/brave/brave-core.git","ssh_url":"git@github.com:brave/brave-core.git","clone_url":"https://github.com/brave/brave-core.git","svn_url":"https://github.com/brave/brave-core","homepage":"","size":44194,"stargazers_count":122,"watchers_count":122,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":33,"open_issues":12,"watchers":122,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brave/brave-core/pulls/432"},"html":{"href":"https://github.com/brave/brave-core/pull/432"},"issue":{"href":"https://api.github.com/repos/brave/brave-core/issues/432"},"comments":{"href":"https://api.github.com/repos/brave/brave-core/issues/432/comments"},"review_comments":{"href":"https://api.github.com/repos/brave/brave-core/pulls/432/comments"},"review_comment":{"href":"https://api.github.com/repos/brave/brave-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brave/brave-core/pulls/432/commits"},"statuses":{"href":"https://api.github.com/repos/brave/brave-core/statuses/2d372315340c9efdb323a4931df32246e46b184e"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":30,"deletions":1,"changed_files":2}}
{"actor":{"display_login":"yrliou"}}