Skip to content

Commit

Permalink
Merge branch '0.9-maintenance'
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Sep 6, 2014
2 parents a96ffa0 + f709a29 commit e63f3f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions werkzeug/serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,16 @@ def _get_openssl_crypto_module():
from werkzeug.exceptions import InternalServerError


def _iter_headers(lineiter):
def _iter_headers(message):
"""Super crappy way to iterate over lines that might look like HTTP
headers. This must only be used with preparsed HTTP messages. This
would be nice if it was not necessary but unfortunately the rfc822
Message in the stdlib is not very good.
"""
if PY2:
lineiter = message.headers
else:
lineiter = message._headers
rv = []
for line in lineiter:
if not line[:1].isspace():
Expand Down Expand Up @@ -123,7 +127,7 @@ def shutdown_server():
'SERVER_PROTOCOL': self.request_version
}

for key, value in _iter_headers(self.headers.headers):
for key, value in _iter_headers(self.headers):
key = 'HTTP_' + key.upper().replace('-', '_')
if key not in ('HTTP_CONTENT_TYPE', 'HTTP_CONTENT_LENGTH'):
if key in environ:
Expand Down

0 comments on commit e63f3f0

Please sign in to comment.