Re: Syntax-based normalization on relative URIs?

Sebastian Pipping wrote:
> Sebastian Pipping wrote:
> > Why are dot segments not removed when normalizing
> > relative URIs? For example this testcase from 4Suite:
> > 
> >   pathSegmentNormalizationTests = [
> >     ..
> >     ('a/b/../../c', 'a/b/../../c'),
> >     ..
> > 
> >   (and not "c" instead)
> > 
> > A short explanation or a link would be great.
> 
> Anybody? I had code normalizing relative
> URIs almost ready and then stumbled upon
> this testcase again. In case I asked this
> before I cannot find the related mail.
> Please help me!

That particular test is for a pair of functions that implement RFC 3986 sec. 
6.2.2.3 (Path Segment Normalization). One function takes a full URI or URI 
reference, and the other takes just the path component of a URI or URI 
reference. They each return a string with the path normalized. However, the 
API docs for those functions say "If the path is relative, it is returned with 
no changes." So the test case you're looking at is reflecting that 
expectation.

I'm having trouble remembering why I did this.

Mike

Received on Sunday, 24 February 2008 07:17:15 UTC