#27999: TestClient does not correctly handle 307 and 308 redirects -----------------------------------------+------------------------ Reporter: anentropic | Owner: nobody Type: Uncategorized | Status: new Component: Uncategorized | Version: 1.10 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -----------------------------------------+------------------------ In the TestClient... 308 status is not recognised at all currently.
307 is just treated the same as the other redirects (301, 302, 303) and is converted to a GET request, regardless of the original request method. This is incorrect according to the RFCs... 307 and 308 redirects are supposed to preserve the original method and request body, so a POST request resulting in 307 response should cause the client to re-POST the body to the new Location. https://tools.ietf.org/html/rfc7231#section-6.4.7 https://tools.ietf.org/html/rfc7538#page-3 I'm happy to prepare a PR for this if it's agreed this should be changed. -- Ticket URL: <https://code.djangoproject.com/ticket/27999> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/053.a4079d3026e6dee22718fd71ca7253eb%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.