]> git.eshelyaron.com Git - emacs.git/commitdiff
Treat 302 redirects as if they were 303 redirects
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 13 Apr 2018 00:21:30 +0000 (02:21 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 13 Apr 2018 00:21:30 +0000 (02:21 +0200)
* lisp/url/url-http.el (url-http-parse-headers): Treat 302 as 303,
since this is what the standards recommend these days (bug#25703).
See https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection

lisp/url/url-http.el

index aed0efab01a22c3ae73c5658969042860d6ea020..e2d7a50e29c17aaca058bbaa131e1c14bc512f28 100644 (file)
@@ -623,6 +623,12 @@ should be shown to the user."
            ;; We do not support agent-driven negotiation, so we just
            ;; redirect to the preferred URI if one is provided.
            nil)
+           (`found                     ; 302
+           ;; 302 Found was ambiguously defined in the standards, but
+           ;; it's now recommended that it's treated like 303 instead
+           ;; of 307, since that's what most servers expect.
+           (setq url-http-method "GET"
+                 url-http-data nil))
            (`see-other                 ; 303
            ;; The response to the request can be found under a different
            ;; URI and SHOULD be retrieved using a GET method on that