http URI grammar

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

http URI grammar

Yves Lafon
In rfc2616, the production was:
    http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]]

from 2396bis:
abs_path became path-absolute in 2396bis

    path          = path-abempty    ; begins with "/" or is empty
                  / path-absolute   ; begins with "/" but not "//"
                  / path-noscheme   ; begins with a non-colon segment
                  / path-rootless   ; begins with a segment
                  / path-empty      ; zero characters

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

    segment       = *pchar
    segment-nz    = 1*pchar

The current definition in -11 [1] is

      http-URI = "http:" "//" authority path-abempty [ "?" query ]

One difference is that httpbis now allows
* http://www.example.com//foo
* http://www.example.com
as valid URIs (which is fine), but also allows http://www.example.com?foo
is that desired? Should it be changed to

      http-URI = "http:" "//" authority ( path-empty /
                                          1*( "/" segment) [ "?" query ] )
or
      http-URI = "http:" "//" authority ( path-empty /
                                          path-absolute [ "?" query ] )

[1] http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-11#section-2.6.1

--
Baroula que barouleras, au tiéu toujou t'entourneras.

         ~~Yves


Reply | Threaded
Open this post in threaded view
|

RE: http URI grammar

Eric Lawrence-4
>http://www.example.com?foo

In my experience, real world sites will use URLs like this from time to time, and as far as I know, all major browsers work with such URLs.

-Eric

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Yves Lafon
Sent: Wednesday, August 04, 2010 7:45 AM
To: [hidden email]
Subject: http URI grammar

In rfc2616, the production was:
    http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]]

from 2396bis:
abs_path became path-absolute in 2396bis

    path          = path-abempty    ; begins with "/" or is empty
                  / path-absolute   ; begins with "/" but not "//"
                  / path-noscheme   ; begins with a non-colon segment
                  / path-rootless   ; begins with a segment
                  / path-empty      ; zero characters

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

    segment       = *pchar
    segment-nz    = 1*pchar

The current definition in -11 [1] is

      http-URI = "http:" "//" authority path-abempty [ "?" query ]

One difference is that httpbis now allows
* http://www.example.com//foo
* http://www.example.com
as valid URIs (which is fine), but also allows http://www.example.com?foo is that desired? Should it be changed to

      http-URI = "http:" "//" authority ( path-empty /
                                          1*( "/" segment) [ "?" query ] ) or
      http-URI = "http:" "//" authority ( path-empty /
                                          path-absolute [ "?" query ] )

[1] http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-11#section-2.6.1

--
Baroula que barouleras, au tiéu toujou t'entourneras.

         ~~Yves



Reply | Threaded
Open this post in threaded view
|

RE: http URI grammar

Daniel Stenberg
On Fri, 6 Aug 2010, Eric Lawrence wrote:

>> http://www.example.com?foo
>
> In my experience, real world sites will use URLs like this from time to
> time, and as far as I know, all major browsers work with such URLs.

Yeps. And us trying to work with URLs that the browsers accept have been
"forced" to accept such URLs as well, so I can only agree that this syntax is
indeed used and accepted "out there".

--

  / daniel.haxx.se

Reply | Threaded
Open this post in threaded view
|

Re: http URI grammar

Roy T. Fielding
On Aug 6, 2010, at 11:44 AM, Daniel Stenberg wrote:

> On Fri, 6 Aug 2010, Eric Lawrence wrote:
>
>>> http://www.example.com?foo
>>
>> In my experience, real world sites will use URLs like this from time to time, and as far as I know, all major browsers work with such URLs.
>
> Yeps. And us trying to work with URLs that the browsers accept have been "forced" to accept such URLs as well, so I can only agree that this syntax is indeed used and accepted "out there".

And that's why the generic syntax was updated for RFC3986, as well.
It looks ugly, but at least we know how to parse it now.

....Roy