b.t.h.w.RelpathSetter(object) : class documentation

Part of bzrlib.transport.http.wsgi View In Hierarchy

WSGI middleware to set 'bzrlib.relpath' in the environ.

Different servers can invoke a SmartWSGIApp in different ways. This middleware allows an adminstrator to configure how to the SmartWSGIApp will determine what path it should be serving for a given request for many common situations.

For example, a request for "/some/prefix/repo/branch/.bzr/smart" received by a typical Apache and mod_fastcgi configuration will set REQUEST_URI to "/some/prefix/repo/branch/.bzr/smart". A RelpathSetter with prefix="/some/prefix/" and path_var="REQUEST_URI" will set that request's 'bzrlib.relpath' variable to "repo/branch".

Method __init__ Constructor.
Method __call__ Undocumented
def __init__(self, app, prefix='', path_var='REQUEST_URI'):
Constructor.
ParametersappWSGI app to wrap, e.g. a SmartWSGIApp instance.
path_varthe variable in the WSGI environ to calculate the 'bzrlib.relpath' variable from.
prefixa prefix to strip from the variable specified in path_var before setting 'bzrlib.relpath'.
def __call__(self, environ, start_response):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.