Skip to content

Commit

Permalink
Lowercase headers coming back from WSGI responses (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie authored and andrewgodwin committed Oct 19, 2018
1 parent 164207b commit 69013c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion asgiref/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def start_response(self, status, response_headers, exc_info=None):
status_code = int(status_code)
# Extract headers
headers = [
(name.encode("ascii"), value.encode("ascii"))
(name.lower().encode("ascii"), value.encode("ascii"))
for name, value in response_headers
]
# Build and send response start message.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def wsgi_application(environ, start_response):
assert (await instance.receive_output(1)) == {
"type": "http.response.start",
"status": 200,
"headers": [(b"X-Colour", b"Blue")],
"headers": [(b"x-colour", b"Blue")],
}
assert (await instance.receive_output(1)) == {
"type": "http.response.body",
Expand Down

0 comments on commit 69013c4

Please sign in to comment.