Skip to content

Commit

Permalink
Define custom content type for Page Template (fixes #1212) (#1213)
Browse files Browse the repository at this point in the history
* - define custom content type for Page Template (fixes #1212)

* - simplifying the solution
  • Loading branch information
dataflake committed May 18, 2024
1 parent 98b703e commit 0187e3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/zopefoundation/Zope/issues/1212>`_)

- Clean up and fix installation documentation.

- Officially support Python 3.12.1.
Expand Down
2 changes: 1 addition & 1 deletion src/webdav/NullResource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0187e3a

Please sign in to comment.