From 8d5f2ded4270da0047200a6251af76d23332b28b Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 4 Sep 2016 12:52:29 +0200 Subject: [PATCH] Describe encoding of Etag --- radicale/storage.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/radicale/storage.py b/radicale/storage.py index d102e6e..5885f6e 100644 --- a/radicale/storage.py +++ b/radicale/storage.py @@ -100,7 +100,11 @@ def load(configuration, logger): def get_etag(text): - """Etag from collection or item.""" + """Etag from collection or item. + + Encoded as quoted-string (see RFC 2616). + + """ etag = md5() etag.update(text.encode("utf-8")) return '"%s"' % etag.hexdigest() @@ -205,6 +209,7 @@ class Item: @property def etag(self): + """Encoded as quoted-string (see RFC 2616).""" return get_etag(self.serialize()) @@ -262,6 +267,7 @@ class BaseCollection: @property def etag(self): + """Encoded as quoted-string (see RFC 2616).""" return get_etag(self.serialize()) @classmethod