Actually send status text

This commit is contained in:
Andrew Godwin 2016-02-09 12:56:03 -08:00
parent f90736413a
commit c9f3b57ea3

View File

@ -119,7 +119,7 @@ class WebRequest(http.Request):
if isinstance(status_text, six.text_type): if isinstance(status_text, six.text_type):
logger.warn("HTTP status text for %s was text - should be bytes", self.reply_channel) logger.warn("HTTP status text for %s was text - should be bytes", self.reply_channel)
status_text = status_text.encode("ascii") status_text = status_text.encode("ascii")
self.setResponseCode(message['status'], ) self.setResponseCode(message['status'], status_text)
# Write headers # Write headers
for header, value in message.get("headers", {}): for header, value in message.get("headers", {}):
self.setHeader(header.encode("utf8"), value) self.setHeader(header.encode("utf8"), value)