Commit cff311aa authored by Guido van Rossum's avatar Guido van Rossum

Be more careful than the previous patch. The default content-type

should only be set to application/x-www-form-urlencoded when the
method is POST.  E.g. for PUT, an empty default (defaulting to
text/plain later) makes more sense.
parent e894fc0e
......@@ -802,7 +802,10 @@ class FieldStorage:
headers = {'content-type':
"application/x-www-form-urlencoded"}
if headers is None:
headers = {'content-type': "application/x-www-form-urlencoded"}
headers = {}
if method == 'POST':
# Set default content-type for POST to what's traditional
headers['content-type'] = "application/x-www-form-urlencoded"
if environ.has_key('CONTENT_TYPE'):
headers['content-type'] = environ['CONTENT_TYPE']
if environ.has_key('CONTENT_LENGTH'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment