svrist
svrist

Reputation: 7110

How to make Flask respond in same HTTP version as request

How can I get flask to respond with HTTP/1.0 to a HTTP/1.0 request? Or someway force a HTTP/1.0 response?

Right now I just do flaskext.genshi.render_response('tmplate.xml', ...data...)

But when I do $ curl -0 -XPOST ... -D - I get

HTTP/1.1 200 OK
Server: ...

back

I've tried logging flask.request.environ['SERVER_PROTOCOL'] before doing the render_response and that is indeed HTTP/1.0

Upvotes: 3

Views: 3133

Answers (1)

svrist
svrist

Reputation: 7110

I figured out, this is not an issue with Flask that talks via Werkzeug with gunicorn. It the behavior of nginx: http://trac.nginx.org/nginx/ticket/112 (and apparently an ok behavior at that)

Upvotes: 2

Related Questions