Allow additional HTTP headers in configuration file
Best ratio coolness/sloc ever!
This commit is contained in:
parent
040d3b87a8
commit
fab7796ca0
5
config
5
config
@ -126,3 +126,8 @@ config = /etc/radicale/logging
|
||||
debug = False
|
||||
# Store all environment variables (including those set in the shell)
|
||||
full_environment = False
|
||||
|
||||
|
||||
# Additional HTTP headers
|
||||
#[headers]
|
||||
#Access-Control-Allow-Origin = *
|
||||
|
@ -313,6 +313,10 @@ class Application(object):
|
||||
"Response content:\n%s" % self.decode(answer, environ))
|
||||
headers["Content-Length"] = str(len(answer))
|
||||
|
||||
if config.has_section("headers"):
|
||||
for key in config.options("headers"):
|
||||
headers[key] = config.get("headers", key)
|
||||
|
||||
# Start response
|
||||
status = "%i %s" % (status, client.responses.get(status, "Unknown"))
|
||||
log.LOGGER.debug("Answer status: %s" % status)
|
||||
|
Loading…
Reference in New Issue
Block a user