From 595e2329ea3c48762b816ea42f414dd5bbf16a35 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Thu, 7 Apr 2016 19:03:27 +0200 Subject: [PATCH] Don't create collections on GET requests --- radicale/__init__.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index a41a8ca..ee36d2c 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -120,9 +120,9 @@ class Application(object): def __init__(self): """Initialize application.""" super().__init__() - auth.load() - storage.load() - rights.load() + auth._load() + storage._load() + rights._load() self.encoding = config.get("encoding", "request") if config.getboolean("logging", "full_environment"): self.headers_log = lambda environ: environ @@ -413,19 +413,10 @@ class Application(object): etag = item.etag else: return client.NOT_FOUND, {}, None + elif not collection.exists: + log.LOGGER.debug("Collection %s unknown" % collection.name) + return client.NOT_FOUND else: - # Create the collection if it does not exist - if not collection.exists: - if collection in write_collections: - log.LOGGER.debug( - "Creating collection %s" % collection.name) - collection.write() - else: - log.LOGGER.debug( - "Collection %s not available and could not be created " - "due to missing write rights" % collection.name) - return NOT_ALLOWED - # Get whole collection answer_text = collection.text etag = collection.etag