Make copy of headers before mutating
This commit is contained in:
parent
f7e995f9f6
commit
20b1480399
@ -265,6 +265,7 @@ class Application:
|
|||||||
"""Manage a request."""
|
"""Manage a request."""
|
||||||
|
|
||||||
def response(status, headers={}, answer=None):
|
def response(status, headers={}, answer=None):
|
||||||
|
headers = headers.copy()
|
||||||
# Set content length
|
# Set content length
|
||||||
if answer:
|
if answer:
|
||||||
self.logger.debug("Response content:\n%s", answer)
|
self.logger.debug("Response content:\n%s", answer)
|
||||||
@ -380,6 +381,7 @@ class Application:
|
|||||||
self.logger.info("%s refused" % (user or "Anonymous user"))
|
self.logger.info("%s refused" % (user or "Anonymous user"))
|
||||||
status = client.UNAUTHORIZED
|
status = client.UNAUTHORIZED
|
||||||
realm = self.configuration.get("server", "realm")
|
realm = self.configuration.get("server", "realm")
|
||||||
|
headers = headers.copy()
|
||||||
headers.update ({
|
headers.update ({
|
||||||
"WWW-Authenticate":
|
"WWW-Authenticate":
|
||||||
"Basic realm=\"%s\"" % realm})
|
"Basic realm=\"%s\"" % realm})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user