{"action":"created","issue":{"url":"https://api.github.com/repos/servo/rust-url/issues/143","repository_url":"https://api.github.com/repos/servo/rust-url","labels_url":"https://api.github.com/repos/servo/rust-url/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/servo/rust-url/issues/143/comments","events_url":"https://api.github.com/repos/servo/rust-url/issues/143/events","html_url":"https://github.com/servo/rust-url/issues/143","id":118258565,"number":143,"title":"Add a no path case to urls","user":{"login":"pyfisch","id":2781017,"avatar_url":"https://avatars.githubusercontent.com/u/2781017?v=3","gravatar_id":"","url":"https://api.github.com/users/pyfisch","html_url":"https://github.com/pyfisch","followers_url":"https://api.github.com/users/pyfisch/followers","following_url":"https://api.github.com/users/pyfisch/following{/other_user}","gists_url":"https://api.github.com/users/pyfisch/gists{/gist_id}","starred_url":"https://api.github.com/users/pyfisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyfisch/subscriptions","organizations_url":"https://api.github.com/users/pyfisch/orgs","repos_url":"https://api.github.com/users/pyfisch/repos","events_url":"https://api.github.com/users/pyfisch/events{/privacy}","received_events_url":"https://api.github.com/users/pyfisch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-22T11:31:54Z","updated_at":"2016-05-02T15:56:29Z","closed_at":null,"body":"Currently the path of URLs is represented by a `Vec<String>`. The empty vector represents the path `/`. In HTTP one needs to reconstruct the effective URL. rust-url supports almost all cases but it does make a difference between no-path and root-path. Server-wide [OPTIONS requests](https://httpwg.github.io/specs/rfc7231.html#OPTIONS) use a special path of `*` and proxys must relay requests such as `OPTIONS http://www.example.org:8001 HTTP/1.1` as `OPTIONS * HTTP/1.1` to the final server. With a trailing slash like in  `OPTIONS http://www.example.org:8001/ HTTP/1.1` the meaning of the request changes but both URLs are parsed as the same URL by rust-url.\r\n\r\nI propose to change the type of `RelativeSchemeData.path` to `Option<Vec<String>>` to be able to represent all URLs commonly used in HTTP. I think this is possible without changing the signature and meaning of many functions and preserving the current functionality but be able to check if there was a path in the URL or not if necessarry."},"comment":{"url":"https://api.github.com/repos/servo/rust-url/issues/comments/216275719","html_url":"https://github.com/servo/rust-url/issues/143#issuecomment-216275719","issue_url":"https://api.github.com/repos/servo/rust-url/issues/143","id":216275719,"user":{"login":"SimonSapin","id":291359,"avatar_url":"https://avatars.githubusercontent.com/u/291359?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonSapin","html_url":"https://github.com/SimonSapin","followers_url":"https://api.github.com/users/SimonSapin/followers","following_url":"https://api.github.com/users/SimonSapin/following{/other_user}","gists_url":"https://api.github.com/users/SimonSapin/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonSapin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonSapin/subscriptions","organizations_url":"https://api.github.com/users/SimonSapin/orgs","repos_url":"https://api.github.com/users/SimonSapin/repos","events_url":"https://api.github.com/users/SimonSapin/events{/privacy}","received_events_url":"https://api.github.com/users/SimonSapin/received_events","type":"User","site_admin":false},"created_at":"2016-05-02T15:56:29Z","updated_at":"2016-05-02T15:56:29Z","body":"@pyfisch I don’t see in the HTTP RFC what defines that `OPTIONS http://www.example.org:8001` and `OPTIONS http://www.example.org:8001/` are different. What am I missing?"}}