Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions hyper/http20/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ def __init__(self, headers, stream):
self.reason = ''

# The response headers. These are determined upon creation, assigned
# once, and never assigned again.
# This conversion to dictionary is unwise, as there may be repeated
# keys, but it's acceptable for an early alpha.
self._headers = dict(headers)
# once, and never assigned again. If a header name is repeated, its
# values are concatenated with ``,``.
list_headers = {}
for name, value in headers:
list_headers.setdefault(name, []).append(value)
self._headers = {name: ','.join(value) for name, value in list_headers.items()}

#: The status code returned by the server.
self.status = int(self._headers[':status'])
Expand Down