You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
got defaults to preserving the method verb when following redirects (e.g. a POST with a redirect issues another POST) as described in the README. request did the opposite, choosing to rewrite 301 and 302 to GET by default. This is not documented in the migration guide.
Edit:
I didn't realize that this was already mostly covered by #1307. Ignoring the rest of the suggestion here, I would mention it in the migration guide now before a fix is introduced in got 12.
request's behavior actually follows the spec more closely in this regard. As I read it, rewriting implies changing the verb from the original, not retaining it.
> Early user agents split on whether the method applied to the redirect target would be the same as the original request [the former semantics] or would be rewritten as GET [the latter semantics]. > ... > prevailing practice gradually converged on the latter semantics for 301 and 302 as well. > ... > Over 10 years later, most user agents still do method rewriting for 301 and 302; therefore, this specification makes that behavior conformant when the original request is POST.
As changing got's default would be a breaking change, correcting the documentation both in the migration guide as well as the README is probably best.
Checklist
I have read the documentation.
The text was updated successfully, but these errors were encountered:
Describe the bug
got defaults to preserving the method verb when following redirects (e.g. a POST with a redirect issues another POST) as described in the README. request did the opposite, choosing to rewrite 301 and 302 to GET by default. This is not documented in the migration guide.
Edit:
I didn't realize that this was already mostly covered by #1307. Ignoring the rest of the suggestion here, I would mention it in the migration guide now before a fix is introduced in got 12.
request's behavior actually follows the spec more closely in this regard. As I read it, rewriting implies changing the verb from the original, not retaining it.From the RFC:> Early user agents split on whether the method applied to the redirect target would be the same as the original request [the former semantics] or would be rewritten as GET [the latter semantics].> ...> prevailing practice gradually converged on the latter semantics for 301 and 302 as well.> ...> Over 10 years later, most user agents still do method rewriting for 301 and 302; therefore, this specification makes that behavior conformant when the original request is POST.As changing got's default would be a breaking change, correcting the documentation both in the migration guide as well as the README is probably best.Checklist
The text was updated successfully, but these errors were encountered: