[mod_python] no fragments in uri

Michael S. Fischer michael at dynamine.net
Wed Apr 21 10:03:26 EST 2004


There's nothing wrong with mod_python.  req.uri has only what is requested
from the server via the GET header, but neither the host nor the fragment is
given to the server by the browser.  Watch the application-level traffic and
see for yourself.

When name-based virtual hosting is being used, you can additionally examine
the Host: header.

Best,

--Michael

> -----Original Message-----
> From: mod_python-bounces at modpython.org 
> [mailto:mod_python-bounces at modpython.org] On Behalf Of Daniel 
> J. Popowich
> Sent: Wednesday, April 21, 2004 8:46 AM
> To: mod_python at modpython.org
> Subject: [mod_python] no fragments in uri
> 
> 
> I'm using modpython 3.1.3 built against python 2.3.2 and 
> apache 2.0.40.  I'm not getting uri fragments from 
> req.unparsed_uri or req.parsed_uri.  For example, with this handler:
> 
>     from mod_python import apache
> 
>     def handler(req):
> 
> 	req.content_type = 'text/plain'
> 	req.write('unparsed_uri: %s\n' % req.unparsed_uri)
> 	req.write('parsed_uri: %s\n' % str(req.parsed_uri))
> 
> 	return apache.OK
> 
> 
> And specifying this URL with my browser:
> 
>     http://localhost/~dpopowich/py/?abc=1#foo
> 
> I'm getting this output:
> 
>     unparsed_uri: /~dpopowich/py/?abc=1
>     parsed_uri: (None, None, None, None, None, None, 
> '/~dpopowich/py/', 'abc=1', None)
> 
> Note how parsed_uri is also missing scheme and host info as well.
> 
> Whereas the following python script gives expected output:
> 
>     import urlparse
>     print 
> urlparse.urlsplit('http://localhost/~dpopowich/py/?abc=1#foo')
> 
> Output:
> 
>     ('http', 'localhost', '/~dpopowich/py/', 'abc=1', 'foo')
> 
> 
> ------------------
> Daniel Popowich
> Network Specialist
> -------------------------------------
> Mohawk Trail Regional School District
> 24 Ashfield Rd.
> Shelburne Falls, MA 01370
> 413.625.0192 x14
> -------------------------------------
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
> 
> 
> 



More information about the Mod_python mailing list