Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes Class Reference

List of all members.

Public Member Functions

def __init__
def __call__

Public Attributes


Detailed Description

On windows environment variables are limited to the system charset
which makes it impossible to store the `PATH_INFO` variable in the
environment without loss of information on some systems.

This is for example a problem for CGI scripts on a Windows Apache.

This fixer works by recreating the `PATH_INFO` from `REQUEST_URI`,
`REQUEST_URL`, or `UNENCODED_URL` (whatever is available).  Thus the
fix can only be applied if the webserver supports either of these

:param app: the WSGI application

Definition at line 43 of file

Constructor & Destructor Documentation

Definition at line 58 of file

00059     def __init__(self, app):
00060 = app

Member Function Documentation

def (   self,

Definition at line 61 of file

00062     def __call__(self, environ, start_response):
00063         for key in 'REQUEST_URL', 'REQUEST_URI', 'UNENCODED_URL':
00064             if key not in environ:
00065                 continue
00066             request_uri = unquote(environ[key])
00067             script_name = unquote(environ.get('SCRIPT_NAME', ''))
00068             if request_uri.startswith(script_name):
00069                 environ['PATH_INFO'] = request_uri[len(script_name):] \
00070                     .split('?', 1)[0]
00071                 break
00072         return, start_response)

Member Data Documentation

Definition at line 59 of file

The documentation for this class was generated from the following file: