Re: a case of a .. too many

Gisle Aas (aas@bergen.sn.no)
12 Apr 1997 09:43:12 +0200


Nicolai Langfeldt <janl@math.uio.no> writes:

> The document
> http://wp1.washingtonpost.com/cgi-bin/search?F1=Taxes+and+Investing&RELEVANCE_RANK=0&HIT_TEMP_NAME=..%2Fdocs%2Fwp-srv%2Ftemplates%2Fglassman%2Ftaxes.tmpl&DEFAULT_OPERATOR=and&TOTAL_HITLIST=1000&DB_NAME=glassman&FIELD_SORT=MAN_SORT_DATE%2FD
> refers to several docs in ../..  .  Since the base url is
> http://wp1.washingtonpost.com/cgi-bin/search this is above the root of
> the server -> http://wp1.washingtonpost.com/../.  Netscape removes the
> leading '..'  in such cases.  I've notified bugs@netscape.com, but I
> don't know if they will consider this a misfeature or not.  Maybe the
> URL theorists on this list will have something to say about what the
> correct behaviour for such references is?

RFC1808 says this:

   Parsers must be careful in handling the case where there are more
   relative path ".." segments than there are hierarchical levels in the
   base URL's path.  Note that the ".." syntax cannot be used to change
   the <net_loc> of a URL.

      ../../../g    = <URL:http://a/../g>
      ../../../../g = <URL:http://a/../../g>

>                                             Me, I tend to think it's
> silly to refer to something above the root of the server.
> 
>   DB<1> $base=url 'http://wp1.washingtonpost.com/cgi-bin/search';
> 
>   DB<2> $url=url('../../wp-srv/business/longterm/glassman/taxes/philan.htm',$base)
>   DB<3> p $url->abs($base) 
> http://wp1.washingtonpost.com/../wp-srv/business/longterm/glassman/taxes/philan.
> 
> Nicolai
> 

-- 
Gisle Aas <aas@sn.no>