Skip to content

Commit

Permalink
[Enhancement] Make redirects with status code 303 change the method t…
Browse files Browse the repository at this point in the history
…o 'GET'


This behavior is as described by RFC 2616. This change is in addition to issue request#55 and issue request#90 (pull request)
  • Loading branch information
stolsma committed Dec 11, 2011
1 parent 550036e commit 2eb1349
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ Request.prototype.request = function () {
self.uri = response.headers.location
self.redirects.push( { statusCode : response.statusCode,
redirectUri: response.headers.location })
//following RFC 2616
if (response.statusCode===303) {
self.method='GET';
}
delete self.req
delete self.agent
delete self._started
Expand Down

0 comments on commit 2eb1349

Please sign in to comment.