On 20-Nov-05 11:04:30 Francois PIETTE wrote:

>>>>>The question is: Should the HTTP client component implement this
>>>>>path removal algorithm ?
>>>> If it is formally valid yes. But it could be tricky to do because
>>>> sometimes the relative path could be a little "strange" :-)
>>>Can you give and example of "strange" relative path ?
>>  ../../adir/subdir/../anothersubdir/./etc/../../where_I_am
>> This can happen when the path is "composed". I don't know if it is
>> happen in the web, I followed a similar discussion in the development
>> of an OS so I "traslated" it for the web.
>> BTW is the "." allowed?

>Yes, a "." is allowed but has no effect. The algorithm to absolutize such
>relative path is not very complex. You have to prepend the current path
>before processing. Then simply replace all "/./" by "/", then remove ending
>"/.", then parse from left to right, each time you find a "subdir/..", you
>simply delete it. Until there is no more "/.." in the path.

I know that the algorithm is not complex :-) I want only point out
that it is possible that the relative parte could be even in the
middle and not only at start.

Bye, Maurizio.

To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to