Permalink
Browse files

Attempt to recover from non-uri-encoded location headers

  • Loading branch information...
1 parent 047b7b5 commit c7deab0227b00c88d4f647f43523f93920d306a2 @jfhbrook committed Mar 4, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 main.js
View
3 main.js
@@ -439,6 +439,9 @@ Request.prototype.start = function () {
if (!isUrl.test(response.headers.location)) {
response.headers.location = url.resolve(self.uri.href, response.headers.location)
}
+ if ( ! /%25/.test(encodeURI(response.headers.location))) {
+ response.headers.location = encodeURI(response.headers.location)
+ }
self.uri = response.headers.location
self.redirects.push(
{ statusCode : response.statusCode

0 comments on commit c7deab0

Please sign in to comment.