self.send_response(response)
self.send_connection_header()
self.send_header("Content-Length", length)
+ for header, value in config.items('headers'):
+ self.send_header(header, value)
+
def handle_one_request(self):
"""Handle a single HTTP request.
"pam_service": "passwd",
},
"storage": {
- "folder": os.path.expanduser("~/.config/calypso/calendars")}}
+ "folder": os.path.expanduser("~/.config/calypso/calendars")
+ },
+ "headers": {
+ },
+}
# Create a ConfigParser and configure it
_CONFIG_PARSER = ConfigParser()
# created if not present
folder = ~/.config/calypso/calendars
+# The headers section allows verbatim addition of static headers to
+# responses. The following exemplary headers are useful when the calendar
+# should be accessed from users' web browsers using a web application hosted on
+# a different server.
+#
+#[headers]
+#Access-Control-Allow-Origin = *
+#Access-Control-Allow-Credentials = *
+#Access-Control-Allow-Methods = GET, POST, PUT, DELETE, PROPFIND, REPORT
+#Access-Control-Allow-Headers = accept, authorization, content-type, depth, x-client, if-match
+
# vim:ft=cfg