Re: [apps-discuss] Scope of RFC3986 and successor - what is a URI?

ht@inf.ed.ac.uk (Henry S. Thompson) Thu, 15 January 2015 14:53 UTC

Return-Path: <ht@inf.ed.ac.uk>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 546D91B2BFB for <apps-discuss@ietfa.amsl.com>; Thu, 15 Jan 2015 06:53:25 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.211
X-Spam-Level:
X-Spam-Status: No, score=-4.211 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OF8Pdj2GVgbT for <apps-discuss@ietfa.amsl.com>; Thu, 15 Jan 2015 06:53:21 -0800 (PST)
Received: from treacle.ucs.ed.ac.uk (treacle.ucs.ed.ac.uk [129.215.16.102]) by ietfa.amsl.com (Postfix) with ESMTP id 70F901B2BF2 for <apps-discuss@ietf.org>; Thu, 15 Jan 2015 06:53:20 -0800 (PST)
Received: from crunchie.inf.ed.ac.uk (crunchie.inf.ed.ac.uk [129.215.33.180]) by treacle.ucs.ed.ac.uk (8.13.8/8.13.4) with ESMTP id t0FErHLt005412; Thu, 15 Jan 2015 14:53:17 GMT
Received: from troutbeck.inf.ed.ac.uk (troutbeck.inf.ed.ac.uk [129.215.25.32]) by crunchie.inf.ed.ac.uk (8.14.4/8.14.4) with ESMTP id t0FErGBs003278; Thu, 15 Jan 2015 14:53:16 GMT
Received: from troutbeck.inf.ed.ac.uk (localhost [127.0.0.1]) by troutbeck.inf.ed.ac.uk (8.14.4/8.14.4) with ESMTP id t0FErG0k019946; Thu, 15 Jan 2015 14:53:16 GMT
Received: (from ht@localhost) by troutbeck.inf.ed.ac.uk (8.14.4/8.14.4/Submit) id t0FErF71019942; Thu, 15 Jan 2015 14:53:15 GMT
X-Authentication-Warning: troutbeck.inf.ed.ac.uk: ht set sender to ht@inf.ed.ac.uk using -f
To: Sam Ruby <rubys@intertwingly.net>
References: <20140926010029.26660.82167.idtracker@ietfa.amsl.com> <DM2PR0201MB09602B351692D424A49C6B0DC3650@DM2PR0201MB0960.namprd02.prod.outlook.com> <CACweHNBN_Bv=jeXQ_VwXi2HzHKNEwZJ1NiF-BJJo_9-mhO60gQ@mail.gmail.com> <54A557E1.6050502@intertwingly.net> <CACweHNCQZg1U1u8U=-f6h0+BPnp6Wr_T=r_wGiPAbhTbuMCGWQ@mail.gmail.com> <54A94109.5010901@intertwingly.net> <00cf01d02cc7$d5dba4c0$4001a8c0@gateway.2wire.net> <54B16C2B.9050604@seantek.com> <54B17BBE.4000900@intertwingly.net> <54B18B61.8010308@seantek.com> <54B19435.8070401@intertwingly.net> <54B1B211.3050807@seantek.com> <54B1B682.3070609@intertwingly.net> <012001d02d91$6ec42300$4001a8c0@gateway.2wire.net> <54B2781C.4040505@intertwingly.net> <018e01d02dc6$1d03b0a0$4001a8c0@gateway.2wire.net> <54B2CC75.5080900@intertwingly.net> <54B79930.3070009@ninebynine.org> <54B7AEC2.9010109@intertwingly.net> <CAKHUCzz=jZAF-i2_pwGpkER5vNhv95CMwdBCMwigPJ0FA_t4_A@mail.gmail.com> <54B7BD4A.1090803@intertwingly.net>
From: ht@inf.ed.ac.uk
Date: Thu, 15 Jan 2015 14:53:15 +0000
In-Reply-To: <54B7BD4A.1090803@intertwingly.net> (Sam Ruby's message of "Thu\, 15 Jan 2015 08\:14\:50 -0500")
Message-ID: <f5ba91kjdt0.fsf@troutbeck.inf.ed.ac.uk>
User-Agent: Gnus/5.101 (Gnus v5.10.10) XEmacs/21.5-b33 (linux)
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-7"
Content-Transfer-Encoding: quoted-printable
X-Edinburgh-Scanned: at treacle.ucs.ed.ac.uk with MIMEDefang 2.60, Sophie, Sophos Anti-Virus, Clam AntiVirus
X-Scanned-By: MIMEDefang 2.60 on 129.215.16.102
Archived-At: <http://mailarchive.ietf.org/arch/msg/apps-discuss/fYaOzcdYfscrwIco7vySBCFFhLk>
Cc: Graham Klyne <gk@ninebynine.org>, "apps-discuss@ietf.org" <apps-discuss@ietf.org>
Subject: Re: [apps-discuss] Scope of RFC3986 and successor - what is a URI?
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss/>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Jan 2015 14:53:25 -0000

Sam Ruby writes:

> As a concrete, current, and actionable topic, apparently it is
> desirable and common practice to include square brackets in the
> search/query component of "clean URLs":
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=1121826

So I want to take this (small) part of your message to try to
understand your implicit requirements process.

The bug report referenced there has a few key factual nuggets:

  1) 3986 [1] does not include '[' and ']' among the URL code points;

  2) The WHATWG URL document is tricky on this point as it stands
     today (2015-01-15): ']' and '[' are not allowed in queries, it is
     a parse error if they do, but the implicit error recovery step
     taken when they _do_ appear is to include them in the parsed URL
     without escaping them.

  3) IE8 and Chrome? do not %-encode '[' or ']' in the query string,
     whereas Firefox35 does %-encode;

On this basis you assert "apparently it is desirable and common
practice to include square brackets in ... 'clean URLS'".

My concern here is _not_ with the specifics of how square brackets are
_or_ should be handled, in browsers or in specs, but rather with how
we should make decisions about such questions.  What can we conclude
based on the facts listed above in this regard?  Insofar as the two
documents involved overlap, they agree -- a string with '[' and/or ']'
in what would otherwise be the query part of a URI/URL is not in fact
a URI/URL -- it fails to conform to the respective definitions
thereof.

The WHATWG document goes further, into a space which is evidently
out-of-scope for 3986, and defines an error recovery procedure for
such strings.  That procedure, it should be noted, _does_
percent-encode some other non-allowed characters when they appear in
the query part, including e.g. '<' and '>'.

Standardising error recovery is clearly a reasonable goal, once the
decision not to take a draconian approach is made.  But in the
(manifest) absence of agreement between existing implementations as to
what that error recovery should be, how should a choice be made?

We now return to your statement, quoted above, as it appears to
contain an answer to that question -- might makes right.  That is,
because Chrome and IE don't %-encode as part of error recovery, and
between them they have more market share than Firefox, Firefox loses,
and must stop doing it.  Obviously that's a caricature of an argument,
not an actual argument.  I'm confident you _have_ an actual argument
in mind, but I can't figure out what it might be.  Please enlighten
me.  Note that "because the WHATWG spec says so" is not sufficient,
because there must be a reason _why_ it says so.

ht

[1] https://tools.ietf.org/html/rfc3986
[2] https://url.spec.whatwg.org/

**Appendix**

The relevant bits of the WHATWG URL document are as follows:

      "A query must be zero or more *URL units*." [3]
      "The *URL units* are *URL code points* and percent-encoded bytes." [3]
      "The URL code points are ASCII alphanumeric, "!", ... [a list
       not including '[' or ']']" [3]

      "[if c is '[' or ']'], run these steps:
         1. If c is not a URL code point and not "%", *parse error*.
         2. ...
         3. Append c to buffer.

       [after processing all the characters into the buffer]
        ...
          3. For each byte in buffer run these subsubsteps:
             1. If byte is less than 0x21, greater than 0x7E, or is
             one of 0x22, 0x23, 0x3C, 0x3E, and 0x60, append byte,
             percent encoded, to url’s query.

          2. Otherwise, append a code point whose value is byte to
          url’s query." [4]

  The 'must' in the first quote above is a 2119 'must'.

[3] https://url.spec.whatwg.org/#url-writing
[4] https://url.spec.whatwg.org/#query-state
-- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                       URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]