Da bin ich auf folgendes Problem gestoßen. mod_python macht mit SCRIPT_NAME/PATH_INFO was es will. Deswegen hab ich jetzt auch einen grausamen hack eingbaut:
Code: Alles auswählen
# *snip*
# XXX: argh. a very stupid way for this problem but
# mod_python otherwise does everything with our
# SCRIPT_NAME/PATH_INFO but that what wsgi expects.
# the problem in short:
# script installed on /a using .htaccess
#
# URI SCRIPT_NAME PATH_INFO
# ----------------------------------------------------------------
# /a /a
# /a/ /a /
# /a/b /a/b
# /a/b/ /a/b /
# /a/b/c /a/b /c
# /a/b/c/d /a/b /c/d
# WTF????
if not options.get('dont_use_mitsuhikos_hack', '').lower()\
in ('1', 'on', 'yes'):
path_info = None
if 'PATH_TRANSLATED' in environ:
_, script_name, prefix = environ['SCRIPT_NAME'].split('/', 2)
script_name = '/' + script_name
path_info = '/' + prefix + environ.get('PATH_INFO', '')
elif not 'PATH_INFO' in environ:
bits = environ['SCRIPT_NAME'].split('/')
script_name = '/'.join(bits[:-1])
path_info = '/' + bits[-1]
if script_name == '/':
script_name = ''
environ['SCRIPT_NAME'] = script_name
if path_info:
environ['PATH_INFO'] = path_info
# *snip*
2.) warum brauch ich diesen hack
3.) wie kann ich das verhinden?