From: Mark Wooding Date: Sat, 13 Jul 2013 15:34:40 +0000 (+0100) Subject: cgi.py: Emit the error about `POST' content-type correctly. X-Git-Tag: 1.0.3~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/chopwood/commitdiff_plain/76ee7d4f64bc1f20013f44c8045cd708ef0b9641 cgi.py: Emit the error about `POST' content-type correctly. --- diff --git a/cgi.py b/cgi.py index 01fb868..6006062 100644 --- a/cgi.py +++ b/cgi.py @@ -401,7 +401,8 @@ def cgiparse(): if not n.isdigit(): raise U.ExpectedError, (500, "Invalid CONTENT_LENGTH") n = int(n, 10) - if getenv('CONTENT_TYPE') != 'application/x-www-form-urlencoded': + ct = getenv('CONTENT_TYPE') + if ct != 'application/x-www-form-urlencoded': raise U.ExpectedError, (500, "Unexpected content type `%s'" % ct) q = SYS.stdin.read(n) if len(q) != n: