[Web-SIG] Converting REQUEST_URI to wsgi.script_name/wsgi.path_info
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 |
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Web-SIG