Skip to content

Commit

Permalink
Fixing case where + is in user or password.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeal committed Apr 17, 2011
1 parent 243a565 commit 83a9cec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ Request.prototype.request = function () {


if (options.uri.auth && !options.headers.authorization) {
options.headers.authorization = "Basic " + toBase64(options.uri.auth.split(':').map(qs.unescape).join(':'));
options.headers.authorization = "Basic " + toBase64(options.uri.auth.split(':').map(function(item){ return qs.unescape(item)}).join(':'));
}
if (options.proxy && options.proxy.auth && !options.headers['proxy-authorization']) {
options.headers['proxy-authorization'] = "Basic " + toBase64(options.proxy.auth.split(':').map(qs.unescape).join(':'));
options.headers.authorization = "Basic " + toBase64(options.uri.auth.split(':').map(function(item){ return qs.unescape(item)}).join(':'));
}

options.path = options.uri.href.replace(options.uri.protocol + '//' + options.uri.host, '');
Expand Down

0 comments on commit 83a9cec

Please sign in to comment.