storage/get+discover: only add items not exceeding max-resource-size

This commit is contained in:
Peter Bieringer
2026-03-26 07:56:38 +01:00
parent e55ccefeb3
commit 24c0832762
2 changed files with 6 additions and 3 deletions

View File

@@ -77,6 +77,7 @@ class StoragePartDiscover(StorageBase):
if href: if href:
item = collection._get(href) item = collection._get(href)
if item is not None: if item is not None:
if pathutils.file_check_size(filesystem_path, self._max_resource_size):
yield item yield item
return return

View File

@@ -175,6 +175,7 @@ class CollectionPartGet(CollectionPartCache, CollectionPartLock,
href) href)
yield (href, None) yield (href, None)
else: else:
if pathutils.file_check_size(path, self._storage._max_resource_size):
yield (href, self._get(href, verify_href=False)) yield (href, self._get(href, verify_href=False))
def get_all(self) -> Iterator[radicale_item.Item]: def get_all(self) -> Iterator[radicale_item.Item]:
@@ -183,4 +184,5 @@ class CollectionPartGet(CollectionPartCache, CollectionPartLock,
# are from os.listdir. # are from os.listdir.
item = self._get(href, verify_href=False) item = self._get(href, verify_href=False)
if item is not None: if item is not None:
if pathutils.file_check_size(os.path.join(self._filesystem_path, href), self._storage._max_resource_size):
yield item yield item