Re: [apps-discuss] Fun with URLs and regex

"Roy T. Fielding" <fielding@gbiv.com> Thu, 29 January 2015 01:24 UTC

Return-Path: <fielding@gbiv.com>
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 095A71A8A8D for <apps-discuss@ietfa.amsl.com>; Wed, 28 Jan 2015 17:24:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.666
X-Spam-Level:
X-Spam-Status: No, score=-1.666 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, IP_NOT_FRIENDLY=0.334, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
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 S8MDO3ecFOrh for <apps-discuss@ietfa.amsl.com>; Wed, 28 Jan 2015 17:24:56 -0800 (PST)
Received: from homiemail-a49.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by ietfa.amsl.com (Postfix) with ESMTP id 2EF1A1A8A8C for <apps-discuss@ietf.org>; Wed, 28 Jan 2015 17:24:56 -0800 (PST)
Received: from homiemail-a49.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a49.g.dreamhost.com (Postfix) with ESMTP id ECD97200D3072; Wed, 28 Jan 2015 17:24:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gbiv.com; h=subject :mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=gbiv.com; bh=Rw01ZeiS8+wkiPbGVaOrZVgTFIg=; b=Nw0RHeAzXiFhvtXsPcivgz8GdWgb pZbIQSmVRdZOonmYpYnKhUUMjH8u/gFW7NmJ/2gGmh5thlwde2Sq/0dljxdKlYGu 14Dtok5WAMs1KU9RMCEVr3LssGBRNBHabDnr3G+TZvOvmRqvmrgVLKwqoc7dtORz LHPSIA/btzF8L0Y=
Received: from [192.168.1.12] (ip68-228-83-124.oc.oc.cox.net [68.228.83.124]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: fielding@gbiv.com) by homiemail-a49.g.dreamhost.com (Postfix) with ESMTPSA id BC03F200D3071; Wed, 28 Jan 2015 17:24:55 -0800 (PST)
Mime-Version: 1.0 (Apple Message framework v1283)
Content-Type: text/plain; charset="us-ascii"
From: "Roy T. Fielding" <fielding@gbiv.com>
In-Reply-To: <CACweHNBHiEGUwLB3z6YoTexF=b9ApwsUy6-DVCf9vnBSD+L5Rw@mail.gmail.com>
Date: Wed, 28 Jan 2015 17:24:55 -0800
Content-Transfer-Encoding: 7bit
Message-Id: <E6AB5A9F-D1DF-45A2-AAEF-FCF2752FD254@gbiv.com>
References: <C5B10293-E6F6-4348-9782-C9C00A4476CE@mnot.net> <CACweHNBVOrVMesB7HOjPNHe5FtzL1k9XDGAHUXAx5DbOSYv5jA@mail.gmail.com> <A1E5B0EC-FAD5-4178-8C7B-540BEB61DC06@mnot.net> <54AEB660.1020701@intertwingly.net> <F122ADA8-4A96-4F88-BB9F-3C5C6A544067@mnot.net> <54C84872.5040902@intertwingly.net> <EF1E36FA-6A30-4A65-9520-5A31571EE445@mnot.net> <54C95132.2060402@gmx.de> <154ABFBB-AB8C-447A-89A3-D1746EFBF1C6@gbiv.com> <54C95AF7.6030703@gmx.de> <CACweHNBHiEGUwLB3z6YoTexF=b9ApwsUy6-DVCf9vnBSD+L5Rw@mail.gmail.com>
To: Matthew Kerwin <matthew@kerwin.net.au>
X-Mailer: Apple Mail (2.1283)
Archived-At: <http://mailarchive.ietf.org/arch/msg/apps-discuss/bDcgO5L5H_LZjUGZqjy10e04U1E>
Cc: Julian Reschke <julian.reschke@gmx.de>, Mark Nottingham <mnot@mnot.net>, IETF Apps Discuss <apps-discuss@ietf.org>
Subject: Re: [apps-discuss] Fun with URLs and regex
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, 29 Jan 2015 01:24:57 -0000

On Jan 28, 2015, at 3:59 PM, Matthew Kerwin wrote:

> On 29/01/2015, Julian Reschke <julian.reschke@gmx.de> wrote:
>> 
>> I agree that the fragment is part of the URI; the question, as far as I
>> understand, is whether the *scheme* definition should include the
>> fragment, given the fact that you can attach a fragment to any URI anyway.
>> 
> 
> The answer to this affects what I write in the 'file' scheme draft. I
> was advised early on to not mention fragments (which I took as
> "disallow by omission") because, while it's easy to define syntax, the
> scheme also has to define semantics, and fragment semantics are tied
> to content type, and dereferenced 'file' URIs don't have a
> well-defined content type.
> 
> Whether or not I mention it comes back to the definition and intended
> use-case of RFC 3986; if it defines an 'abstract' syntax - in the POO
> sense - then there's no such thing as a universal parser (i.e. It's
> impossible to parse a URI with an unknown scheme). If it defines a
> low-level structure, then any URI can be parsed, but the individual
> components can't be validated without deferring to scheme-specific
> machinery.
> 
> If the former and I don't include the fragment in 'file', it isn't
> allowed. If the latter, I just leave a hole in the spec.

It isn't that black and white.  The grammar for the scheme is what
excludes a fragment.  That doesn't prevent the scheme docs from
talking about fragments (in reference to RFC3986) and using them
within examples.

That part of the URI spec was written specifically to address
issues created by folks who thought they could redefine the meaning
of fragments within individual schemes, or forbid them entirely,
when in fact the meaning and use of fragments are independent of
scheme.

What makes you think that dereferenced files don't have a well-defined
content type?  The client might not know what it is, but that doesn't
mean the content type doesn't exist, and any decision to process the
file is basically an assumption of some content type (and its rules
for processing fragments).

....Roy