X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=python3%2Fashd-wsgi3;h=dcf161320bf78805929d7207f719ba08d8eb6111;hp=cdabec34dc143721c82c3c4358a8c76a2d7d857b;hb=0bf0720d9d585a56904081d0c8a71507d8889adf;hpb=cefb0f7aedb9e3f0a2c04e7258ab07a243638e75 diff --git a/python3/ashd-wsgi3 b/python3/ashd-wsgi3 index cdabec3..dcf1613 100755 --- a/python3/ashd-wsgi3 +++ b/python3/ashd-wsgi3 @@ -135,6 +135,10 @@ def dowsgi(req): ("HTTP_X_ASH_ADDRESS", "REMOTE_ADDR"), ("HTTP_CONTENT_TYPE", "CONTENT_TYPE"), ("HTTP_CONTENT_LENGTH", "CONTENT_LENGTH"), ("HTTP_X_ASH_PROTOCOL", "wsgi.url_scheme")]: if src in env: env[tgt] = env[src] + for key in ["HTTP_CONTENT_TYPE", "HTTP_CONTENT_LENGTH"]: + # The CGI specification does not strictly require this, but + # many actualy programs and libraries seem to. + if key in env: del env[key] if "X-Ash-Protocol" in req and req["X-Ash-Protocol"] == b"https": env["HTTPS"] = "on" if "X-Ash-File" in req: env["SCRIPT_FILENAME"] = absolutify(req["X-Ash-File"].decode(locale.getpreferredencoding())) env["wsgi.input"] = req.sk