{"action":"created","issue":{"url":"https://api.github.com/repos/danielwertheim/mycouch/issues/75","labels_url":"https://api.github.com/repos/danielwertheim/mycouch/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/danielwertheim/mycouch/issues/75/comments","events_url":"https://api.github.com/repos/danielwertheim/mycouch/issues/75/events","html_url":"https://github.com/danielwertheim/mycouch/issues/75","id":69558225,"number":75,"title":"URL being escaped when getting design documents with authentication","user":{"login":"davidedwardjohnson","id":11981126,"avatar_url":"https://avatars.githubusercontent.com/u/11981126?v=3","gravatar_id":"","url":"https://api.github.com/users/davidedwardjohnson","html_url":"https://github.com/davidedwardjohnson","followers_url":"https://api.github.com/users/davidedwardjohnson/followers","following_url":"https://api.github.com/users/davidedwardjohnson/following{/other_user}","gists_url":"https://api.github.com/users/davidedwardjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/davidedwardjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidedwardjohnson/subscriptions","organizations_url":"https://api.github.com/users/davidedwardjohnson/orgs","repos_url":"https://api.github.com/users/davidedwardjohnson/repos","events_url":"https://api.github.com/users/davidedwardjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/davidedwardjohnson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/danielwertheim/mycouch/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/danielwertheim/mycouch/labels/investigate","name":"investigate","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-04-20T10:37:59Z","updated_at":"2015-05-20T17:25:50Z","closed_at":"2015-04-24T23:06:11Z","body":"Hi there,\r\n\r\nI have run into an issue when attempting to get a design document for a database when authentication is enabled.\r\nWhen trying to GET a design document with the Id \"_design/users\" then UrlSegment escapes the URL and the eventual request gets sent to \r\n\r\n*databasename*/_design%2Fusers\r\n\r\nThe response from CouchDB is a 301 to the actual URL /*databasename*/_design/users which the HttpClient automatically redirects to.  I can see this using Fiddler.\r\nThe problem arises here because the default behaviour of HttpClient appears to not include any authentication information in the redirect as explained on MSDN.\r\n\r\nhttps://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.allowautoredirect%28v=vs.110%29.aspx\r\n\r\nThis means that against a database with authentication turned on these requests will always fail.\r\n\r\nThis issue does not happen when using Cloudant as it appears that it can accept URLs that have been escaped without having to do a redirect.\r\n\r\nDavid"},"comment":{"url":"https://api.github.com/repos/danielwertheim/mycouch/issues/comments/103967686","html_url":"https://github.com/danielwertheim/mycouch/issues/75#issuecomment-103967686","issue_url":"https://api.github.com/repos/danielwertheim/mycouch/issues/75","id":103967686,"user":{"login":"SrGrieves","id":555742,"avatar_url":"https://avatars.githubusercontent.com/u/555742?v=3","gravatar_id":"","url":"https://api.github.com/users/SrGrieves","html_url":"https://github.com/SrGrieves","followers_url":"https://api.github.com/users/SrGrieves/followers","following_url":"https://api.github.com/users/SrGrieves/following{/other_user}","gists_url":"https://api.github.com/users/SrGrieves/gists{/gist_id}","starred_url":"https://api.github.com/users/SrGrieves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SrGrieves/subscriptions","organizations_url":"https://api.github.com/users/SrGrieves/orgs","repos_url":"https://api.github.com/users/SrGrieves/repos","events_url":"https://api.github.com/users/SrGrieves/events{/privacy}","received_events_url":"https://api.github.com/users/SrGrieves/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T17:25:50Z","updated_at":"2015-05-20T17:25:50Z","body":"@danielwertheim Thank you.  Works perfectly (using v.3.2.0)."}}