X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=python%2Fashd-wsgi;h=894211d8a5ab66023bbbefca547982f188c3f2cf;hp=e43dbc0c04f11f3e6d665cff39ceb2c7ea1c63a0;hb=53d666cafb4af8f07bf74af9278702db82085d45;hpb=e09f3227872481af1a7bafe50d71a60f47292ac2 diff --git a/python/ashd-wsgi b/python/ashd-wsgi index e43dbc0..894211d 100755 --- a/python/ashd-wsgi +++ b/python/ashd-wsgi @@ -92,10 +92,6 @@ def dowsgi(req): env["SERVER_PROTOCOL"] = req.ver env["REQUEST_METHOD"] = req.method env["REQUEST_URI"] = req.url - try: - env["PATH_INFO"] = unquoteurl(req.rest) - except: - env["PATH_INFO"] = req.rest name = req.url p = name.find('?') if p >= 0: @@ -104,8 +100,19 @@ def dowsgi(req): else: env["QUERY_STRING"] = "" if name[-len(req.rest):] == req.rest: + # This is the same hack used in call*cgi. name = name[:-len(req.rest)] + try: + pi = unquoteurl(req.rest) + except: + pi = req.rest + if name == '/': + # This seems to be normal CGI behavior, but see callcgi.c for + # details. + pi = "/" + pi + name = "" env["SCRIPT_NAME"] = name + env["PATH_INFO"] = pi if "Host" in req: env["SERVER_NAME"] = req["Host"] if "X-Ash-Server-Port" in req: env["SERVER_PORT"] = req["X-Ash-Server-Port"] if "X-Ash-Protocol" in req and req["X-Ash-Protocol"] == "https": env["HTTPS"] = "on"