From 0187e3acefbe97d04a271d7538aede2e90e7b2e0 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Sat, 18 May 2024 05:06:27 +0000 Subject: [PATCH] Define custom content type for Page Template (fixes #1212) (#1213) * - define custom content type for Page Template (fixes #1212) * - simplifying the solution --- CHANGES.rst | 3 +++ src/webdav/NullResource.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index edac84affb..690f733840 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,9 @@ https://github.com/zopefoundation/Zope/blob/4.x/CHANGES.rst 5.9.1 (unreleased) ------------------ +- Recognize Page Templates by file extension for WebDAV. + (`#1212 `_) + - Clean up and fix installation documentation. - Officially support Python 3.12.1. diff --git a/src/webdav/NullResource.py b/src/webdav/NullResource.py index 02deb8ba5f..687803a3d7 100644 --- a/src/webdav/NullResource.py +++ b/src/webdav/NullResource.py @@ -114,7 +114,7 @@ def _default_PUT_factory(self, name, typ, body): if ext == '.dtml': ob = DTMLDocument('', __name__=name) - elif typ in ('text/html', 'text/xml'): + elif ext in ('.pt', '.zpt') or typ in ('text/html', 'text/xml'): ob = ZopePageTemplate(name, body, content_type=typ) elif typ.startswith('image/'): ob = Image(name, '', body, content_type=typ)