Commit f702d89d authored by Brian Sutherland's avatar Brian Sutherland

Prevent ZPublisher from insering incorrect <base/> tags into the

headers of plain html files served from Zope3 resource directories.

Also cleanup whitespace in CHANGES.txt.
parent 14f00911
......@@ -190,6 +190,9 @@ Zope Changes
- Collector #2187: PUT_factory broken (fwd port from 2.10 branch).
- Prevent ZPublisher from insering incorrect <base/> tags into the
headers of plain html files served from Zope3 resource directories.
Other Changes
- Disabled docutils file inclusion completely, rather than trying
......
......@@ -61,6 +61,9 @@ class PageTemplateResource(BrowserView, Resource):
def render(self):
"""Rendered content"""
# ZPublisher might have called setBody with an incorrect URL
# we definitely don't want that if we are plain html
self.request.RESPONSE.setBase(None)
pt = self.context
return pt(self.request)
......
......@@ -78,6 +78,33 @@ We also can traverse into sub-directories:
<BLANKLINE>
We also can traverse into sub-directories:
>>> print http(r'''
... GET /test_folder_1_/testoid/++resource++fivetest_resources/resource_subdir/resource.txt HTTP/1.1
... Authorization: Basic manager:r00t
... ''')
HTTP/1.1 200 OK
...
This is a resource in a subdirectory of a normal resource to test traversal.
<BLANKLINE>
>>> print http(r'''
... GET /test_folder_1_/testoid/++resource++fivetest_resources/resource_subdir/resource.html 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>
Clean up
--------
......
<html>
<head>
</head>
<body>
This .html should not have a base tag automatically
added to the header.
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment