[Web-SIG] Request for Comments on upcoming WSGI Changes

Ian Bicking ianb at colorstudy.com
Tue Sep 22 07:31:20 CEST 2009


On Tue, Sep 22, 2009 at 12:21 AM, Graham Dumpleton <
graham.dumpleton at gmail.com> wrote:
>
> That may be fine for pure Python web servers where you control the
> split of REQUEST_URI into SCRIPT_NAME and PATH_INFO in the first place
> but don't have that luxury in Apache or via FASTCGI/SCGI/CGI etc as
> that is done by the web server. Also, as pointed out in my blog,
> because of rewrites in web server, it may be difficult to try and map
> SCRIPT_NAME and PATH_INFO back into REQUEST_URI provided to try and
> reclaim original characters. There is also the problem that often
> FASTCGI totally stuffs up SCRIPT_NAME/PATH_INFO split anyway and
> manual overrides needed to tweak them.


When things get messed up I recommend people use a middleware
(paste.deploy.config.PrefixMiddleware, though I don't really care what they
use) to fix up the request to be correct.  Pulling it from REQUEST_URI would
be fine.
Also, at worst, you can do environ['SCRIPT_NAME_RAW'] =
urllib.quote(environ.pop('SCRIPT_NAME')).  It sucks, but if that's all the
information you have, then that's all the information you have.  Or try to
get the information from REQUEST_URI the hard way, once at the gateway
level.

-- 
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/20090922/25264fc6/attachment.htm>


More information about the Web-SIG mailing list