shazaman23 / webapp-improved

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

Request.blank cannot set 'content-type' #56

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create an instance of webapp2 app
2. invoke app.get_response('/test', content_type='application/json', data='{}')
3. verify in the request handler the received content-type

What is the expected output? What do you see instead?

The expected 'content-type' is 'application/json', but the actual value is 
'application/x-www-form-urlencoded'

What version of the product are you using? On what operating system?
latest

Please provide any additional information below.

I reviewed the source code at 
http://webapp-improved.appspot.com/_modules/webapp2.html#WSGIApplication.get_res
ponse, the 'content-type' value is hard-coded.

This issue makes it impossible to post an arbitrary content-type to the request 
handle during unit testing. 

Original issue reported on code.google.com by davidshe...@gmail.com on 25 May 2012 at 2:16