[Web-SIG] [proposal] wsgiref.util.abs_url
Phillip J. Eby
pje at telecommunity.com
Sun May 4 19:43:23 CEST 2008
At 11:03 PM 5/2/2008 +0200, Manlio Perillo wrote:
>Hi.
>
>I think that a function like (not tested):
>
>def abs_url(environ, relative_url):
> """Return the absolute url"""
[...]
> url += quote(relative_url)
> return url
>
>would be an useful addition to the wsgiref.util module.
>
>
>What do you think?
I think that it doesn't accept a relative URL, it accepts an absolute path.
I also think that using urlparse.urljoin() with either request_uri()
or application_uri() would be a clearer (and tested) way to obtain an
absolute URL, and more generally useful.
More information about the Web-SIG
mailing list