- if "Content-Type" in req: env["CONTENT_TYPE"] = req["Content-Type"]
- if "Content-Length" in req: env["CONTENT_LENGTH"] = req["Content-Length"]
+ if "Content-Type" in req:
+ env["CONTENT_TYPE"] = req["Content-Type"]
+ # The CGI specification does not strictly require this, but
+ # many actualy programs and libraries seem to.
+ del env["HTTP_CONTENT_TYPE"]
+ if "Content-Length" in req:
+ env["CONTENT_LENGTH"] = req["Content-Length"]
+ del env["HTTP_CONTENT_LENGTH"]