unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: chad <yandros@gmail.com>
To: Daniele Nicolodi <daniele@grinta.net>
Cc: wmperry@gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>,
	EMACS development team <emacs-devel@gnu.org>
Subject: Re: Bug in url-retrieve-synchronously from url.el on redirect
Date: Mon, 13 Jul 2020 11:15:01 -0700	[thread overview]
Message-ID: <CAO2hHWY5vn1Fh=PJy0rE5MzNK7Cdx4w++nz_fapPrfxyb3EZtw@mail.gmail.com> (raw)
In-Reply-To: <ea5a860a-3885-adcd-8061-f4e298f56425@grinta.net>

[-- Attachment #1: Type: text/plain, Size: 2084 bytes --]

Very likely the </> stripping code dates from a time period when code would
recognize strings inside angle-brackets as potential URLs/URIs, and passed
the entire string to the url library out of simplicity. If memory serves,
Bill Perry's original url code dates from the wild and wooly early days of
loose url encoding. I would expect that it can be changed safely.

Hope that helps,
~Chad

On Fri, Jul 10, 2020 at 5:55 PM Daniele Nicolodi <daniele@grinta.net> wrote:

> On 10-07-2020 14:32, Daniele Nicolodi wrote:
> > On 10/07/2020 14:25, Yuri Khan wrote:
> >> On Sat, 11 Jul 2020 at 02:43, Daniele Nicolodi <daniele@grinta.net>
> wrote:
> >>
> >>> As far as I understand the RFCs (and being wrong before, I may be wrong
> >>> again) do not allow for < > quoting either. Why does url-http.el strip
> >>> them? Why does it break the URI at the first space if spaces are not
> >>> allowed?
> >>
> >> I cannot answer that, maybe someone who is knowledgeable about
> >> uri-http.el chimes in.
> >>
> >> RFC 7231 allows clients to attempt to DTRT with invalid Location URIs
> >> in any way they deem appropriate; you could argue for a different
> >> recovery heuristic. Me, I’d rather have things break loudly on each
> >> violation, so that it does not go unnoticed for too long. Postel’s
> >> Razor is how we got HTML in its current shape.
> >
> > I tend to agree with you, but, in this specific case, being compatible
> > with other HTTP implementations is a worthwhile goal.
> >
> > Unfortunately, re-defining url-http-parse-headers is the only
> > work-around I found to make Emacs do the less bad thing when dealing
> > with this malformed URIs.
>
> Bill, you seem to be the author of this code, although Stefan is the one
> that introduced it to the Emacs accordingly to git blame. Do any of you
> know why the redirect Location is handled like that?
>
> I would like to suggest the two attached patches. The first fixes actual
> issues I encountered, the second simply adjusts a comment.
>
> Thank you.
>
> Cheers,
> Dan
>
>

[-- Attachment #2: Type: text/html, Size: 2665 bytes --]

  reply	other threads:[~2020-07-13 18:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 18:18 Bug in url-retrieve-synchronously from url.el on redirect Daniele Nicolodi
2020-07-10 18:49 ` Yuri Khan
2020-07-10 19:37   ` Yuri Khan
2020-07-10 19:46     ` Daniele Nicolodi
2020-07-10 19:43   ` Daniele Nicolodi
2020-07-10 20:25     ` Yuri Khan
2020-07-10 20:32       ` Daniele Nicolodi
2020-07-11  0:55         ` Daniele Nicolodi
2020-07-13 18:15           ` chad [this message]
2020-07-13 18:48             ` 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='CAO2hHWY5vn1Fh=PJy0rE5MzNK7Cdx4w++nz_fapPrfxyb3EZtw@mail.gmail.com' \
    --to=yandros@gmail.com \
    --cc=daniele@grinta.net \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=wmperry@gnu.org \
    /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).