This is historical, 307 and 308 were added later, and I think we couldn't change it without breaking backwards compatibility. That said, 307 and 308 classes could be added to django.http.response and the documentation could recommend their use. Mozilla docs show that they're compatible with all tracked web browsers so most Django sites could use them.
On Tue, 18 Sep 2018 at 07:14, Matthieu Bonnefoy <[email protected]> wrote: > Hi there, > > I am wondering why the default redirect class in the common middleware is > a 301 Moved Permanently response. > > https://github.com/django/django/blob/master/django/middleware/common.py#L32 > https://github.com/django/django/blob/master/django/http/response.py#L476 > > I just got the issue of a POST request being changed as a GET request by > the redirect and found it quite confusing. > It seems that a 308 Permanent Redirect (by the way the name of the > redirect subclass is now a bit confusing) is now widely supported and would > be a better option. > https://tools.ietf.org/html/rfc7538 > https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308 > > +-------------------------------------------+-----------+-----------+ > | | Permanent | Temporary | > +-------------------------------------------+-----------+-----------+ > | Allows changing the request method from | 301 | 302 | > | POST to GET | | | > | Does not allow changing the request | 308 | 307 | > | method from POST to GET | | | > +-------------------------------------------+-----------+-----------+ > > > What do you think? > > Thanks, > Matthieu > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-developers. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/a9f807b8-d31c-4729-a9bc-ac80274d4590%40googlegroups.com > <https://groups.google.com/d/msgid/django-developers/a9f807b8-d31c-4729-a9bc-ac80274d4590%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Adam -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM3REgObCnhfsQvsrqw6b0izukZXieD_49XT03Ny%3DgLH7Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
