tianwen2976 / webapp-improved

Automatically exported from code.google.com/p/webapp-improved
Other
0 stars 0 forks source link

webapp2 in combination with WebOb 1.1 incorrectly sets a content type header in response to GET requests #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Here is the code flow:
1. webapp2.Request.__init__ doesn't see a charset in the Content-Type header so 
it sets charset='UTF-*'
2. webob.BaseRequest.__init__ has this logic:
        if charset is not NoDefault:
            self.charset = charset
3. webob.BaseRequest._charset__set has this logic:

        ...
        content_type = self.environ.get('CONTENT_TYPE', '')
        ...
        self.environ['CONTENT_TYPE'] = content_type

So, if there is no Content-Type header, a new one is created with the value ' ; 
charset=UTF-8'

Original issue reported on code.google.com by bquin...@google.com on 14 Dec 2011 at 4:53

GoogleCodeExporter commented 9 years ago
This issue was closed by revision d36c461b86ba.

Original comment by rodrigo.moraes on 31 Jan 2012 at 6:18