Kaynağa Gözat

Fix GET requests

Guillaume Ayoub 13 yıl önce
ebeveyn
işleme
9f446cb261
1 değiştirilmiş dosya ile 7 ekleme ve 6 silme
  1. 7 6
      radicale/__init__.py

+ 7 - 6
radicale/__init__.py

@@ -356,15 +356,16 @@ class Application(object):
                 # Get whole collection
                 answer_text = collection.text
                 etag = collection.etag
-                headers = {
-                    "Content-Type": collection.mimetype,
-                    "Last-Modified": collection.last_modified,
-                    "ETag": etag}
-                answer = answer_text.encode(self.encoding)
-                return client.OK, headers, answer
             else:
                 return NOT_ALLOWED
 
+        headers = {
+            "Content-Type": collection.mimetype,
+            "Last-Modified": collection.last_modified,
+            "ETag": etag}
+        answer = answer_text.encode(self.encoding)
+        return client.OK, headers, answer
+
     def head(self, environ, collections, content, user):
         """Manage HEAD request."""
         status, headers, answer = self.get(environ, collections, content, user)