Enhance readability
This commit is contained in:
parent
58c6fe399c
commit
77ab37c49c
@ -186,13 +186,13 @@ class Application(object):
|
|||||||
|
|
||||||
# Set content length
|
# Set content length
|
||||||
if answer:
|
if answer:
|
||||||
# Decode the answer for logging purposes on Python 3
|
if isinstance(answer, str):
|
||||||
log_answer = answer
|
log_answer = answer
|
||||||
if not isinstance(log_answer, str):
|
else:
|
||||||
log_answer = log_answer.decode(
|
# Decode the answer for logging purposes on Python 3
|
||||||
config.get("encoding", "request"))
|
log_answer = answer.decode(config.get("encoding", "request"))
|
||||||
log.LOGGER.debug("Response content:\n%s" % log_answer)
|
log.LOGGER.debug("Response content:\n%s" % log_answer)
|
||||||
headers["Content-Length"] = "%i" % len(answer)
|
headers["Content-Length"] = str(len(answer))
|
||||||
|
|
||||||
# Start response
|
# Start response
|
||||||
status = "%i %s" % (status, client.responses.get(status, ""))
|
status = "%i %s" % (status, client.responses.get(status, ""))
|
||||||
|
Loading…
Reference in New Issue
Block a user