[Zope-dev] PATH_INFO reliable?

Casey Duncan cduncan@kaivo.com
Mon, 19 Mar 2001 08:03:24 -0700


Danny William Adair wrote:
> 
> I want to strip off the SERVER_URL of an absolute url (which I have as a
> string) without doing string manipulations. Is there some built-in function
> to do this? So what I'm looking for is actual the reverse of absolute_url.
> 
> The request variable PATH_INFO looks very good, but I don't know whether
> this is _always_ created.
> 
> Thx in advance,
> Danny
> 
> P.S.: Maybe I just got something completely wrong here. Help!
> 

All traversable objects have a method "getPhysicalPath" which returns
the physical path of the object as a tuple of strings. You could do a
string.join on this to construct a url without the server part.

-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>