[Zope-Checkins] SVN: Zope/trunk/ Handle resource files with .htm extention properly as page template resources.
Tres Seaver
tseaver at palladion.com
Fri May 7 23:44:04 EDT 2010
Log message for revision 112180:
Handle resource files with .htm extention properly as page template resources.
LP #411837
Changed:
U Zope/trunk/doc/CHANGES.rst
U Zope/trunk/src/Products/Five/browser/resource.py
U Zope/trunk/src/Products/Five/browser/tests/resource_ftest.txt
A Zope/trunk/src/Products/Five/browser/tests/resource_subdir/resource.htm
-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst 2010-05-08 03:43:03 UTC (rev 112179)
+++ Zope/trunk/doc/CHANGES.rst 2010-05-08 03:44:04 UTC (rev 112180)
@@ -152,6 +152,9 @@
Bugs Fixed
++++++++++
+- LP #411837: Handle resource files with ``.htm`` extention properly,
+ as page template resources.
+
- LP #435729: Fix indentation of OFSP/help/sequence.py docstring.
- LP #574286: Ensure that mailhosts which share a queue directory do not
Modified: Zope/trunk/src/Products/Five/browser/resource.py
===================================================================
--- Zope/trunk/src/Products/Five/browser/resource.py 2010-05-08 03:43:03 UTC (rev 112179)
+++ Zope/trunk/src/Products/Five/browser/resource.py 2010-05-08 03:44:04 UTC (rev 112180)
@@ -133,6 +133,7 @@
'pt': PageTemplateResourceFactory,
'zpt': PageTemplateResourceFactory,
'html': PageTemplateResourceFactory,
+ 'htm': PageTemplateResourceFactory,
}
default_factory = FileResourceFactory
Modified: Zope/trunk/src/Products/Five/browser/tests/resource_ftest.txt
===================================================================
--- Zope/trunk/src/Products/Five/browser/tests/resource_ftest.txt 2010-05-08 03:43:03 UTC (rev 112179)
+++ Zope/trunk/src/Products/Five/browser/tests/resource_ftest.txt 2010-05-08 03:44:04 UTC (rev 112180)
@@ -92,6 +92,21 @@
... response = self.publish(base_url % r, basic='manager:r00t')
... self.assertEquals(200, response.getStatus())
+ >>> print http(r'''
+ ... GET /test_folder_1_/testoid/++resource++fivetest_resources/resource_subdir/resource.htm HTTP/1.1
+ ... Authorization: Basic manager:r00t
+ ... ''')
+ HTTP/1.1 200 OK
+ ...
+ <html>
+ <head>
+ </head>
+ <body>
+ This .html should not have a base tag automatically
+ added to the header.
+ </body>
+ </html>
+ <BLANKLINE>
We also can traverse into sub-directories:
Added: Zope/trunk/src/Products/Five/browser/tests/resource_subdir/resource.htm
===================================================================
--- Zope/trunk/src/Products/Five/browser/tests/resource_subdir/resource.htm (rev 0)
+++ Zope/trunk/src/Products/Five/browser/tests/resource_subdir/resource.htm 2010-05-08 03:44:04 UTC (rev 112180)
@@ -0,0 +1,8 @@
+<html>
+ <head>
+ </head>
+ <body>
+ This .html should not have a base tag automatically
+ added to the header.
+ </body>
+</html>
More information about the Zope-Checkins
mailing list