Scheme Section 2 quibble

Sean Conner sean at conman.org
Wed Nov 18 02:02:09 GMT 2020


It was thus said that the Great Waweic once stated:
> Sean Connor wrote:
> 
> >   The path parsing rules state a single slash.  Not '/'+, nor '/'*,
> > but a
> > single '/'.  The only place where more than a single slash is allowed
> > PER
> > THE @#%@#$@$ ABNF is just prior to the authority, which contains the
> > hostname.  THE ONLY PLACE! 
> 
> I am currently working on a bug in lagrange concerning this question.
> It appeared to me, that multiple consecutive slashes might also be
> allowed in the query, according to the ABNF, but I may be very wrong
> there.

  In the query section, yes, it should be.  In the path section, it should
be disallowed.  Unfortunately, I checked the ABNF in RFC-3986 and it does
appear to allow double slashes in the path section.  The rules in question:

   path-abempty  = *( "/" segment )
   path-absolute = "/" [ segment-nz *( "/" segment ) ]
   path-noscheme = segment-nz-nc *( "/" segment )
   path-rootless = segment-nz *( "/" segment )

   segment       = *pchar

  A segment can be 0 or more characters, so per the spec, you could end up
with muliple slashes, and the URL parsing library I use, written against the
ABNF of RFC-3986, does in fact, accept it:

	["path//to//resource"] =
	{
	  path = "path//to//resource",
	}

  There's nothing in the errata [1] about this, but it seems like it should
be fixed.

  -spc

[1]	https://www.rfc-editor.org/errata_search.php?rfc=3986


More information about the Gemini mailing list