1
0
Fork 0

v1.1.3: Handle relative redirect locations correctly

master
Sven Slootweg 10 years ago
parent fc61235143
commit 9ebbc7d98c

@ -552,7 +552,7 @@ doRedirect = (request, response, requestState, newOptions) ->
response.pipe(devNull()) # Let the response stream drain out...
requestState.redirectHistory.push response
bhttpAPI._doRequest response.headers["location"], newOptions, requestState
bhttpAPI._doRequest urlUtil.resolve(request.url, response.headers["location"]), newOptions, requestState
createCookieJar = (jar) ->
# Creates a cookie jar wrapper with a simplified API.

@ -600,7 +600,7 @@ doRedirect = function(request, response, requestState, newOptions) {
response.pipe(devNull());
}
requestState.redirectHistory.push(response);
return bhttpAPI._doRequest(response.headers["location"], newOptions, requestState);
return bhttpAPI._doRequest(urlUtil.resolve(request.url, response.headers["location"]), newOptions, requestState);
});
};

@ -1,6 +1,6 @@
{
"name": "bhttp",
"version": "1.1.2",
"version": "1.1.3",
"description": "A sane HTTP client library for Node.js with Streams2 support.",
"main": "index.js",
"scripts": {

Loading…
Cancel
Save