diff --git a/config b/config index 4f8a458..bf0c85d 100644 --- a/config +++ b/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 = * diff --git a/radicale/__init__.py b/radicale/__init__.py index 6d6b7c0..f022f95 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -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)