1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-31 19:50:55 +00:00

Correct Content-Type for VLIST in HTTP header

This commit is contained in:
Unrud 2017-08-29 20:08:25 +02:00
parent c1d279e63f
commit a2a046f35f
3 changed files with 12 additions and 6 deletions

View file

@ -607,14 +607,12 @@ class Application:
if not item:
return NOT_FOUND
if isinstance(item, storage.BaseCollection):
collection = item
if collection.get_meta("tag") not in (
"VADDRESSBOOK", "VCALENDAR"):
tag = item.get_meta("tag")
if not tag:
return DIRECTORY_LISTING
content_type = xmlutils.MIMETYPES[tag]
else:
collection = item.collection
content_type = xmlutils.MIMETYPES.get(
collection.get_meta("tag"), "text/plain")
content_type = xmlutils.OBJECT_MIMETYPES[item.name]
headers = {
"Content-Type": content_type,
"Last-Modified": item.last_modified,