{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/dserve/issues/62","repository_url":"https://api.github.com/repos/Automattic/dserve","labels_url":"https://api.github.com/repos/Automattic/dserve/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/dserve/issues/62/comments","events_url":"https://api.github.com/repos/Automattic/dserve/issues/62/events","html_url":"https://github.com/Automattic/dserve/pull/62","id":351287809,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4OTIyMzMw","number":62,"title":"Add subdomain support to dserve","user":{"login":"griffbrad","id":449804,"node_id":"MDQ6VXNlcjQ0OTgwNA==","avatar_url":"https://avatars1.githubusercontent.com/u/449804?v=4","gravatar_id":"","url":"https://api.github.com/users/griffbrad","html_url":"https://github.com/griffbrad","followers_url":"https://api.github.com/users/griffbrad/followers","following_url":"https://api.github.com/users/griffbrad/following{/other_user}","gists_url":"https://api.github.com/users/griffbrad/gists{/gist_id}","starred_url":"https://api.github.com/users/griffbrad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griffbrad/subscriptions","organizations_url":"https://api.github.com/users/griffbrad/orgs","repos_url":"https://api.github.com/users/griffbrad/repos","events_url":"https://api.github.com/users/griffbrad/events{/privacy}","received_events_url":"https://api.github.com/users/griffbrad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"griffbrad","id":449804,"node_id":"MDQ6VXNlcjQ0OTgwNA==","avatar_url":"https://avatars1.githubusercontent.com/u/449804?v=4","gravatar_id":"","url":"https://api.github.com/users/griffbrad","html_url":"https://github.com/griffbrad","followers_url":"https://api.github.com/users/griffbrad/followers","following_url":"https://api.github.com/users/griffbrad/following{/other_user}","gists_url":"https://api.github.com/users/griffbrad/gists{/gist_id}","starred_url":"https://api.github.com/users/griffbrad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griffbrad/subscriptions","organizations_url":"https://api.github.com/users/griffbrad/orgs","repos_url":"https://api.github.com/users/griffbrad/repos","events_url":"https://api.github.com/users/griffbrad/events{/privacy}","received_events_url":"https://api.github.com/users/griffbrad/received_events","type":"User","site_admin":false},"assignees":[{"login":"griffbrad","id":449804,"node_id":"MDQ6VXNlcjQ0OTgwNA==","avatar_url":"https://avatars1.githubusercontent.com/u/449804?v=4","gravatar_id":"","url":"https://api.github.com/users/griffbrad","html_url":"https://github.com/griffbrad","followers_url":"https://api.github.com/users/griffbrad/followers","following_url":"https://api.github.com/users/griffbrad/following{/other_user}","gists_url":"https://api.github.com/users/griffbrad/gists{/gist_id}","starred_url":"https://api.github.com/users/griffbrad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griffbrad/subscriptions","organizations_url":"https://api.github.com/users/griffbrad/orgs","repos_url":"https://api.github.com/users/griffbrad/repos","events_url":"https://api.github.com/users/griffbrad/events{/privacy}","received_events_url":"https://api.github.com/users/griffbrad/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-08-16T16:55:02Z","updated_at":"2018-08-31T15:18:36Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/Automattic/dserve/pulls/62","html_url":"https://github.com/Automattic/dserve/pull/62","diff_url":"https://github.com/Automattic/dserve/pull/62.diff","patch_url":"https://github.com/Automattic/dserve/pull/62.patch"},"body":"Current versions of dserve use a single domain for all commits and branches.  This can allow cross-contamination of client-side resources like cookies, localStorage and assets cached by service workers across different builds/images.\r\n\r\nBy instead using subdomains, we can leverage the browser's built-in mechanisms for isolating domains to ensure that our builds don't interact in unpredictable ways.\r\n\r\nThe new middleware in this commit maintains support for \"hash\" and \"branch\" query string parameters.  When present, those parameters will trigger a redirect to [commit-hash].[host-name].\r\n\r\nThe next middleware in the processing chain then grabs the commit hash from the subdomain and stores it in the session, where the rest of dserve expects to find it.\r\n\r\n## Testing \r\n\r\nTo test locally, you'll need hosts file entries for whichever commits you want to test:\r\n\r\n`127.0.0.1 [commit-hash].calypso.localhost`\r\n\r\nWhen accessing a branch or commit hash via query string parameter, you'll be redirected to the equivalent subdomain.  Navigating to `calypso.localhost:3000?hash=b84096f22f59c307620d4978bc48ea47da65d5a6`, for example, will redirect you to `b84096f22f59c307620d4978bc48ea47da65d5a6.calypso.localhost:3000`.\r\n"},"comment":{"url":"https://api.github.com/repos/Automattic/dserve/issues/comments/417697332","html_url":"https://github.com/Automattic/dserve/pull/62#issuecomment-417697332","issue_url":"https://api.github.com/repos/Automattic/dserve/issues/62","id":417697332,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzY5NzMzMg==","user":{"login":"sirreal","id":841763,"node_id":"MDQ6VXNlcjg0MTc2Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/841763?v=4","gravatar_id":"","url":"https://api.github.com/users/sirreal","html_url":"https://github.com/sirreal","followers_url":"https://api.github.com/users/sirreal/followers","following_url":"https://api.github.com/users/sirreal/following{/other_user}","gists_url":"https://api.github.com/users/sirreal/gists{/gist_id}","starred_url":"https://api.github.com/users/sirreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirreal/subscriptions","organizations_url":"https://api.github.com/users/sirreal/orgs","repos_url":"https://api.github.com/users/sirreal/repos","events_url":"https://api.github.com/users/sirreal/events{/privacy}","received_events_url":"https://api.github.com/users/sirreal/received_events","type":"User","site_admin":false},"created_at":"2018-08-31T15:18:36Z","updated_at":"2018-08-31T15:18:36Z","author_association":"CONTRIBUTOR","body":"> You can actually test D17735-code prior to this PR being merged. Ops folks have already configured the production dserve instance to support subdomains at the server level.\r\n\r\nExcellent, thanks for clearing that up 👍 \r\n\r\nD17801-code does depend on this"}}
{"actor":{"display_login":"sirreal"}}