{"action":"created","issue":{"url":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/3862","repository_url":"https://api.github.com/repos/jupyterlab/jupyterlab","labels_url":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/3862/labels{/name}","comments_url":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/3862/comments","events_url":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/3862/events","html_url":"https://github.com/jupyterlab/jupyterlab/issues/3862","id":296813903,"number":3862,"title":"Coreutils `isLocal` is too broad","user":{"login":"ian-r-rose","id":5728311,"avatar_url":"https://avatars3.githubusercontent.com/u/5728311?v=4","gravatar_id":"","url":"https://api.github.com/users/ian-r-rose","html_url":"https://github.com/ian-r-rose","followers_url":"https://api.github.com/users/ian-r-rose/followers","following_url":"https://api.github.com/users/ian-r-rose/following{/other_user}","gists_url":"https://api.github.com/users/ian-r-rose/gists{/gist_id}","starred_url":"https://api.github.com/users/ian-r-rose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ian-r-rose/subscriptions","organizations_url":"https://api.github.com/users/ian-r-rose/orgs","repos_url":"https://api.github.com/users/ian-r-rose/repos","events_url":"https://api.github.com/users/ian-r-rose/events{/privacy}","received_events_url":"https://api.github.com/users/ian-r-rose/received_events","type":"User","site_admin":false},"labels":[{"id":601544147,"url":"https://api.github.com/repos/jupyterlab/jupyterlab/labels/pkg:coreutils","name":"pkg:coreutils","color":"1d76db","default":false},{"id":387307881,"url":"https://api.github.com/repos/jupyterlab/jupyterlab/labels/type:Bug","name":"type:Bug","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-13T17:03:27Z","updated_at":"2018-02-13T17:36:24Z","closed_at":null,"author_association":"OWNER","body":"Found with @SylvainCorlay.\r\n\r\nIf there is a notebook server deployed with the same host domain as some other resources, the `isLocal` check can pass incorrectly. If you then refer to those resources in a notebook, JupyterLab tries to patch up the url to point to the contents API when it shouldn't.\r\n\r\ncf. https://github.com/jupyterlab/jupyterlab/blob/master/packages/coreutils/src/url.ts#L102\r\n\r\nI think it would be more correct to have the `isLocal` check just be\r\n```typescript\r\nreturn protocol !== 'data:' &&  host === '';\r\n```\r\nrather than\r\n```typescript\r\nreturn protocol !== 'data:' && host === location.host ||  host === '';\r\n```"},"comment":{"url":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/comments/365343392","html_url":"https://github.com/jupyterlab/jupyterlab/issues/3862#issuecomment-365343392","issue_url":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/3862","id":365343392,"user":{"login":"ian-r-rose","id":5728311,"avatar_url":"https://avatars3.githubusercontent.com/u/5728311?v=4","gravatar_id":"","url":"https://api.github.com/users/ian-r-rose","html_url":"https://github.com/ian-r-rose","followers_url":"https://api.github.com/users/ian-r-rose/followers","following_url":"https://api.github.com/users/ian-r-rose/following{/other_user}","gists_url":"https://api.github.com/users/ian-r-rose/gists{/gist_id}","starred_url":"https://api.github.com/users/ian-r-rose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ian-r-rose/subscriptions","organizations_url":"https://api.github.com/users/ian-r-rose/orgs","repos_url":"https://api.github.com/users/ian-r-rose/repos","events_url":"https://api.github.com/users/ian-r-rose/events{/privacy}","received_events_url":"https://api.github.com/users/ian-r-rose/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T17:36:24Z","updated_at":"2018-02-13T17:36:24Z","author_association":"OWNER","body":"I think something that has a host specified shouldn't be considered local (even if the host matches the notebook server host)."}}
{"actor":{"display_login":"ian-r-rose"}}