Use length of encoded error response
This is purely cosmetic. The lengths are the same, because it gets encoded as ASCII.
This commit is contained in:
parent
4cfe92cf50
commit
36bca799e1
@ -327,10 +327,11 @@ class Application:
|
|||||||
self.logger.error("An exception occurred during %s request on %r: "
|
self.logger.error("An exception occurred during %s request on %r: "
|
||||||
"%s", method, path, e, exc_info=True)
|
"%s", method, path, e, exc_info=True)
|
||||||
status, headers, answer = INTERNAL_SERVER_ERROR
|
status, headers, answer = INTERNAL_SERVER_ERROR
|
||||||
|
answer = answer.encode("ascii")
|
||||||
status = "%d %s" % (
|
status = "%d %s" % (
|
||||||
status, client.responses.get(status, "Unknown"))
|
status, client.responses.get(status, "Unknown"))
|
||||||
headers = [("Content-Length", str(len(answer)))] + list(headers)
|
headers = [("Content-Length", str(len(answer)))] + list(headers)
|
||||||
answers = [answer.encode("ascii")]
|
answers = [answer]
|
||||||
start_response(status, headers)
|
start_response(status, headers)
|
||||||
return answers
|
return answers
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user