#31432: Conform to HTTP Status Code RFC's more closely (django.http.response
redirect classes)
------------------------------------------------+------------------------
               Reporter:  Jacob Stöhr           |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Uncategorized         |        Version:  master
               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                     |
------------------------------------------------+------------------------
 Hello,

 while filing (and trying to fix) #31430 I noticed that the class
 `HttpResponsePermanentRedirect` in django.http.response has its
 `status_code` set to `301`.

 According to the `http` python module and more specifically RFC 7238
 ([https://tools.ietf.org/html/rfc7238]) the name `PermanentRedirect` is
 used to describe the HTTP Status code `308`. `301` is called
 `MovedPermanently` according to  RFC 7231
 ([https://tools.ietf.org/html/rfc7231#section-6.4.2]).

 Therefore I propose to rename the class `HttpResponsePermanentRedirect` to
 `HttpResponseMovedPermanently` with a status code of `301` and to modify
 the existing class to have a status code of `308`. I am aware that this is
 backwards incompatible and will break 33 currently existing tests (I
 tested it real quick locally) and probably countless uses in tests.
 However I think it is important to comply with the official spec.

 I would appreciate any feedback, I don't know who would be responsible for
 this kind of ticket so I cannot assign it directly.
 If desired, I could probably come up with a patch or at least help with
 creating one.

 Regards,
 Jacob

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31432>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/054.f4e6a01133fcf4caf7419689bb2bb150%40djangoproject.com.

Reply via email to