Parcourir la source

reduce to 80% for base64 coverage

Peter Bieringer il y a 2 mois
Parent
commit
6e3b277ff5
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      radicale/app/propfind.py

+ 2 - 1
radicale/app/propfind.py

@@ -241,7 +241,8 @@ def xml_propfind_response(
                     base_prefix, "/%s/" % collection.owner)
                     base_prefix, "/%s/" % collection.owner)
                 element.append(child_element)
                 element.append(child_element)
         elif tag == xmlutils.make_clark("C:max-resource-size"):
         elif tag == xmlutils.make_clark("C:max-resource-size"):
-            element.text = str(max_content_length)
+            # RFC4791#5.2.5 use 80% of max_content_length to cover base64 encoding
+            element.text = str(int(max_content_length * 0.8))
         elif is_collection:
         elif is_collection:
             if tag == xmlutils.make_clark("D:getcontenttype"):
             if tag == xmlutils.make_clark("D:getcontenttype"):
                 if is_leaf:
                 if is_leaf: