mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Allow additional HTTP headers in configuration file
Best ratio coolness/sloc ever!
This commit is contained in:
parent
040d3b87a8
commit
fab7796ca0
2 changed files with 9 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue