on 11/18/02 7:22 AM, [EMAIL PROTECTED] purportedly said: > I'm not clear what URI should do here. In a spider fetching /../foo then > fetches /../../foo and so on. > >> perl -MURI -le 'print URI->new_abs("../foo","http://root.com")->as_string' > http://root.com/../foo > > I can fix $uri->path, of course.
Even though '..' may be valid in URIs for certain protocols, it would be more reliable to resolve to a "true" absolute URI, such that http://root.com/../foo becomes http://root.com/foo, and http://root.com/foo/../bar becomes http://root.com/bar, etc. This may be accomplishable with a simple regex: s|/[^/]+/\.\./|/|g on the path, with a check for paths that are: /../etc Keary Suska Esoteritech, Inc. "Leveraging Open Source for a better Internet"