Re: RFC2396, parsing 'authority' and 'host'

On Monday, February 2, 2004, at 05:13  AM, Graham Klyne wrote:
> I just found a bug in my URI parsing code that leads me to suggest a 
> minor revision to the syntax in RFC2396bis:  (taken from CVS revision 
> 1.64, from http://cvs.apache.org/viewcvs.cgi/ietf-uri/rev-2002/)
>
> My error was that I overlooked the square brackets in the host 
> production.
>
> Currently:
>
>   authority   = [ userinfo "@" ] host [ ":" port ]
> and
>   host        = [ IPv6reference / IPv4address / hostname ]
>
> My suggestion is for:
>
>   authority   = [ userinfo "@" ] [ host ] [ ":" port ]
> and
>   host        = IPv6reference / IPv4address / hostname
>
> As well as being less easy to overlook the fact that host is optional, 
> I found it (marginally) easier to code this way.

Due to other changes (that allow host to be of zero length), I have
changed it to

    authority   = [ userinfo "@" ] host [ ":" port ]
and
    host        = IP-literal / IPv4address / reg-name

....Roy

Received on Friday, 13 February 2004 03:55:54 UTC