[Web-SIG] Converting REQUEST_URI to wsgi.script_name/wsgi.path_info

Ian Bicking ianb at colorstudy.com
Mon Sep 28 05:35:12 CEST 2009


I tried implementing some code to convert REQUEST_URI (the raw request URL)
and CGI-style SCRIPT_NAME/PATH_INFO into a raw script_name/path_info.
  http://bitbucket.org/ianb/wsgi-peps/src/tip/request_uri.py (python 2)
  http://bitbucket.org/ianb/wsgi-peps/src/tip/request_uri3.py (python 3)

Admittedly the tests are not very complete, I just wasn't feeling creative
about test cases.  In terms of performance this avoids being entirely brute
force, but feels kind of complex.  I'm betting there's an entirely different
approach which is faster.  But whatever.

-- 
Ian Bicking  |  http://blog.ianbicking.org  |
http://topplabs.org/civichacker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/web-sig/attachments/20090927/9c28d87d/attachment.htm>


More information about the Web-SIG mailing list