Ticket #790: cp3_no_content_type.patch
-
cherrypy/test/test_core.py
old new 885 885 ("Accept-Charset", "unicode-1-1;q=0.8")]) 886 886 self.assertBody("iso-8859-5, unicode-1-1;q=0.8") 887 887 888 # If we don't pass a Content-Type header, it should not be present 889 # in cherrypy.request.headers 888 # If we don't pass a Content-Type header, one will automatically 889 # be added, with an empty value (''). 890 890 self.getPage("/headers/Content-Type", 891 891 headers=[]) 892 self.assertStatus(500) 892 self.assertStatus(200) 893 self.assertBody('') 893 894 894 895 # If Content-Type is present in the request, it should be present in 895 896 # cherrypy.request.headers -
cherrypy/_cpwsgi.py
old new 208 208 209 209 def get_response(self): 210 210 """Run self.request and return its response.""" 211 # Make sure CONTENT_TYPE exists; give it an empty value 212 # if none has already been defined. Without this, 213 # _cpcgifs.FieldStorage attempts to parse params out of the 214 # request body when no Content-Type is defined, leading to 215 # undesired behaviour. (This matches CP2 behaviour) 216 if not self.environ.has_key('CONTENT_TYPE'): 217 self.environ['CONTENT_TYPE'] = '' 218 211 219 meth = self.environ['REQUEST_METHOD'] 212 220 path = _http.urljoin(self.environ.get('SCRIPT_NAME', ''), 213 221 self.environ.get('PATH_INFO', ''))

