Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Commit

Permalink
FIXED don't complain when resource is missing Location header
Browse files Browse the repository at this point in the history
  • Loading branch information
assaf committed Mar 7, 2015
1 parent bfdfcbe commit 69a3126
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/resources.js
Expand Up @@ -441,10 +441,10 @@ Resources.handleHTTPResponse = function(request, response, next) {
if (statusCode === 301 || statusCode === 307) {
// Do not follow POST redirects automatically, only GET/HEAD
if (request.method === 'GET' || request.method === 'HEAD')
redirectUrl = URL.resolve(request.url, response.headers.location);
redirectUrl = URL.resolve(request.url, response.headers.location || '');
} else if (statusCode === 302 || statusCode === 303) {
// Follow redirect using GET (e.g. after form submission)
redirectUrl = URL.resolve(request.url, response.headers.location);
redirectUrl = URL.resolve(request.url, response.headers.location || '');
}

if (redirectUrl) {
Expand Down

0 comments on commit 69a3126

Please sign in to comment.