flask.views.MethodView returns the response body for HEAD #566

ghost opened this Issue Jul 26, 2012 · 2 comments


None yet

2 participants


See https://github.com/mitsuhiko/flask/blob/master/flask/views.py#L148.

When there's no HEAD handler, it uses the GET one but doesn't actually discard the response body, which it should. Most HTTP clients ignore it anyway so this should be safe to fix.

The Pallets Projects member

Sorry if i am wrong, since i don't have much experience with Flask's sourcecode, but couldn't the GET method not just discard the response body (for HEAD requests)?

The Pallets Projects member

That should not happen as Werkzeug is taking care of that when yielding to the WSGI server: https://github.com/mitsuhiko/werkzeug/blob/master/werkzeug/wrappers.py#L1025

@mitsuhiko mitsuhiko closed this Jan 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment