From 76ee7d4f64bc1f20013f44c8045cd708ef0b9641 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 13 Jul 2013 16:34:40 +0100 Subject: [PATCH] cgi.py: Emit the error about `POST' content-type correctly. --- cgi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- 2.11.0