visionmedia/superagent — pull request #408 by jonasfj (2014-07-04 01:06:07+00:00)
Title: Fix 307 redirects

Adds tests that `307` redirects with the same method.

Note, this is not really a perfect implementation. The specification says that anything other than `HEAD` or `GET` must not automatically redirect, which is what this does.

Ideally, we should add a feature similar to `-L` on `curl` which tells superagent that we trust the site and is willing follow `POST`, `PUT`, etc. redirects. Ie. it should be an option, or a user-supplied called back that is used to decide if a 307 redirect should be followed with anything other than `GET` or `HEAD`.

Note, automatically following a 307 `PUT` with a `GET` as superagent didn't before is all bad. If interested I would happily implement a `.trustRedirect(true || false)` option. Other (better) names for such a option would be great though :)