From: Robert Pluim <rpluim@gmail.com>
To: Daniele Nicolodi <daniele@grinta.net>
Cc: 42382@debbugs.gnu.org
Subject: bug#42382: 26.3; url-http handling of Location redirection headers containing whitespace
Date: Thu, 16 Jul 2020 18:08:37 +0200 [thread overview]
Message-ID: <m2pn8vsare.fsf@gmail.com> (raw)
In-Reply-To: <875e714c-28f3-7a4e-7a9e-0f4ce640e336@grinta.net> (Daniele Nicolodi's message of "Wed, 15 Jul 2020 14:40:36 -0600")
>>>>> 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
next prev parent reply other threads:[~2020-07-16 16:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 20:40 bug#42382: 26.3; url-http handling of Location redirection headers containing whitespace Daniele Nicolodi
2020-07-16 16:08 ` Robert Pluim [this message]
2020-07-16 16:30 ` Daniele Nicolodi
2020-07-16 17:10 ` Robert Pluim
2020-07-17 0:01 ` Lars Ingebrigtsen
2020-07-17 15:47 ` Daniele Nicolodi
2020-07-19 19:17 ` Lars Ingebrigtsen
2020-07-20 14:46 ` Daniele Nicolodi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2pn8vsare.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=42382@debbugs.gnu.org \
--cc=daniele@grinta.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).