technoweenie/faraday — Issue #86: Unescape basic auth user and password from URI
Author: mheffner
Created: 2011-10-12 16:16:00+00:00
State: open

To use basic auth when the username (or password) contains a character not valid in a URL, the character has to be escaped. For example, assume your username was 'foo@bar.com', then you would have to construct your URL like:

http://foo%40bar.com:password@myhost.com/somepath

In `Faraday::Connection::url_prefix=`, it will set up basic authentication if it parses the username and password from the URL. However, it doesn't unescape them, so there's no way to correctly do basic auth with the URL above. If you don't escape the @, the URL fails to parse.

`Faraday::Connection::url_prefix=` should unescape the username and password before constructing the auth header.