assaf/zombie — pull request #299 by dewind (2012-03-21 02:28:37+00:00)
Title: Remove 'Content Type' and 'Content Length' from headers on redirect when previous HTTP method was either a POST or PUT

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.

Rationale:

* The redirect is always a GET which means form content types (application/x-www-form-url-encoded, multipart) are invalid
* This was causing Google's OAuth authentication to fail after the user had been authenticated and _redirected_ to the authorization page

Potential pitfalls

* I couldn't find test suite that tested redirects -- I'm inclined to delegate this for now
* The headers object is being modified and passed to other methods. Optimally, we should treat this like an immutable data structure and copy then modify