{"action":"closed","issue":{"url":"https://api.github.com/repos/hyperium/hyper/issues/638","repository_url":"https://api.github.com/repos/hyperium/hyper","labels_url":"https://api.github.com/repos/hyperium/hyper/issues/638/labels{/name}","comments_url":"https://api.github.com/repos/hyperium/hyper/issues/638/comments","events_url":"https://api.github.com/repos/hyperium/hyper/issues/638/events","html_url":"https://github.com/hyperium/hyper/issues/638","id":103739131,"number":638,"title":"Url paths not percent-encoded","user":{"login":"cmbrandenburg","id":4177015,"avatar_url":"https://avatars.githubusercontent.com/u/4177015?v=3","gravatar_id":"","url":"https://api.github.com/users/cmbrandenburg","html_url":"https://github.com/cmbrandenburg","followers_url":"https://api.github.com/users/cmbrandenburg/followers","following_url":"https://api.github.com/users/cmbrandenburg/following{/other_user}","gists_url":"https://api.github.com/users/cmbrandenburg/gists{/gist_id}","starred_url":"https://api.github.com/users/cmbrandenburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmbrandenburg/subscriptions","organizations_url":"https://api.github.com/users/cmbrandenburg/orgs","repos_url":"https://api.github.com/users/cmbrandenburg/repos","events_url":"https://api.github.com/users/cmbrandenburg/events{/privacy}","received_events_url":"https://api.github.com/users/cmbrandenburg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-28T15:24:32Z","updated_at":"2016-05-24T19:12:14Z","closed_at":"2016-05-24T19:12:14Z","body":"Using `Url::path_mut()` to set path components individually doesn't result in a percent-encoded URI. For example:\r\n\r\n    let mut u = hyper::Url::parse(\"http://www.example.com/\").unwrap();\r\n    u.path_mut().unwrap()[0] = \"foo/bar\".to_string();\r\n    println!(\"{}\", u);\r\n    u.path_mut().unwrap()[0] = \"foo?bar\".to_string();\r\n    println!(\"{}\", u);\r\n\r\nOutput:\r\n\r\n    http://www.example.com/foo/bar\r\n    http://www.example.com/foo?bar\r\n\r\nI expect to see:\r\n\r\n    http://www.example.com/foo%2Fbar\r\n    http://www.example.com/foo%3Fbar\r\n\r\nMaybe I'm missing something here, but I don't see any workaround for this problem except to explicitly percent-encode path components in my own code.\r\n\r\n    let mut u = hyper::Url::parse(\"http://www.example.com/\").unwrap();\r\n    u.path_mut().unwrap()[0] = \"foo%2Fbar\".to_string();\r\n    println!(\"{}\", u);\r\n    u.path_mut().unwrap()[0] = \"foo%3Fbar\".to_string();\r\n    println!(\"{}\", u);\r\n\r\n\r\nYuk!"}}
{"actor":{"display_login":"seanmonstar"}}