Why isn't the content-type inherited from response.headers in the HTTP
object construction?

def test():
    response.headers['Content-Type'] = 'application/json'
    raise HTTP(500, json.dumps(dict(test=True)), **response.headers)

HTTP/1.1 500 INTERNAL SERVER ERROR
Path=/
Content-Type: text/html; charset=UTF-8
Date: Sat, 09 Mar 2013 05:05:19 GMT
Server: Rocket 1.2.6 Python/2.7.3
Content-Length: 14
Connection: keep-alive

{"test": true}

def test():
    response.headers['Content-Type'] = 'application/json'
    raise HTTP(500, json.dumps(dict(test=True)))

HTTP/1.1 500 INTERNAL SERVER ERROR
Path=/
Content-Type: application/json
X-Powered-By: web2py
Date: Sat, 09 Mar 2013 05:05:33 GMT
Server: Rocket 1.2.6 Python/2.7.3
Content-Length: 14
Connection: keep-alive

{"test": true}

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to