Don't include CONTENT_TYPE/CONTENT_LENGTH in environ if absent in headers #1308
With the following test application I tested this for gunicorn, gevent, twisted and uwsgi:
# test_app.py from werkzeug.wrappers import Response def application(environ, start_response): content_type = environ.get('CONTENT_TYPE') response = Response(repr(content_type) + '\n') return response(environ, start_response)
Of the four tested, only Twisted handles the environ the way werkzeug does, the others will experience inconsistencies between their test and production environments.
We had trouble reproducing a production error in test because of this as it's currently non-trivial to test a missing content-type header in flask. If absent by default it's easy to test both absent and empty header values, as you can send an empty string in the headers to get the old behavior.
The text was updated successfully, but these errors were encountered: