[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42382: 26.3; url-http handling of Location redirection headers conta
From: |
Robert Pluim |
Subject: |
bug#42382: 26.3; url-http handling of Location redirection headers containing whitespace |
Date: |
Thu, 16 Jul 2020 18:08:37 +0200 |
>>>>> On Wed, 15 Jul 2020 14:40:36 -0600, Daniele Nicolodi <daniele@grinta.net>
>>>>> said:
Daniele> In RFC 7231 the Location header is defined to carry a
URI-reference.
Daniele> According to RFC 3986 it should be percent-encoded and thus should
not
Daniele> contain spaces. However, there are HTTP server implementation
(notably
Daniele> nginx) that do not do that. While this is a bug in those HTTP
server
Daniele> implementations, I think Emacs should follow what most other HTTP
client
Daniele> implementatios (all the ones I tested) and use the content of the
Daniele> Location header unmodified. Stripping of angle bracket quotes is
Daniele> unnecessary as they are not valid according to the RFCs.
Nor is embedded whitespace in the URI :-)
Are you sure this won't break anything? ie are you sure there are 0
server implementations out there that send angle brackets?
Iʼd be conservative, and just replace the truncation on whitespace
with percent-encoding of said whitespace.
Daniele> Also, accordingly to the RFCs, the location header may contain a
Daniele> relative location. Thus the comment that suggest that such a
response is
Daniele> a bug in the server should be reworded.
Daniele> The attached patches implement the proposed changes.
The second patch is small enough that I think you can combine the two.
Robert