Removes extra commit
This pull request ensures that we delete the the 'Content Length' and 'Content Type' from the headers on a redirect when the previous (request) HTTP method was either a POST or a PUT.
Remove content-type and content-length from headers if method was POS…
…T and we redirecting via GET
I had a redirect that failed (i had the following content <html><body></body></html>), and this patch fixed the bug.
I think this also fixes #298
I'm in a case where a host sends me a redirect to another host. Zombie sends the cookies from the first host to the second, and i get unexpected things.
I had to solve it by adding this in the process.nextTick => function
if redirect.host != url.host
Maybe too much things are passed through when a redirect occurs.
It may be wiser to rebuild the headers given a certain set of rules (which should be well defined). Passing the same headers when a 302 is encountered is not wise.
What about passing null to the headers parameters when a redirect occurs ? Headers will be created as if this is a new request.
@_makeRequest "GET", redirect, null, null, resource, callback
Any ideas which headers should pass after redirect?
Clearly cookies need to be reconstructed, there's no document to pass. It is just Accept, User-Agent and Referer? How would we find out?
This probably merits some investigation with regard to common practice on redirects. There may be an established standard or convention.
Did this fix get lost somewhere? Its not in master branch anymore and I am hitting the bug caused by this.
Resource loading got rewritten twice since that commit. There was no test for it, so naturally it got lost.
[#302] Remove 'Content Type' and 'Content Length' on redirect (re-fix…