optilude <optil...@gmail.com> added the comment:

Here is a pretty rough patch for this (not very well tested, and there possibly 
a 
security issue with this)


Index: repoze/zope2/z2bob.py
=============================================================
======
--- repoze/zope2/z2bob.py       (revision 11017)
+++ repoze/zope2/z2bob.py       (working copy)
@@ -404,8 +404,12 @@
         # object to account for the fact that before_traverse code and
         # our next_name method mutates the parents list to insert the
         # published object
-        published = parents.pop()
 
+        if self.browser_default_published is not None:
+            published = self.browser_default_published
+        else:
+            published = parents.pop()
+
         # NB: it's important to reverse the parents list, or legacy VHM
         # hosting doesn't work (for one thing)
         parents.reverse()
@@ -447,7 +451,11 @@
         # we ignore the published that gets passed in; we've set the
         # actual published object in the request within before_invoke
         request = self.request
-        published = request['PUBLISHED']
+
+        if self.browser_default_published is not None:
+            published = self.browser_default_published
+        else:
+            published = request['PUBLISHED']
         result =  mapply(published,
                          positional = request.args,
                          keyword = request,
@@ -617,8 +625,8 @@
     def _getAccumulatedHeaders(self):
         accumulated_headers = self.request.response.accumulated_headers
         L = []
-        more_headers = accumulated_headers.split('\n')
-        for line in more_headers:
+        # more_headers = accumulated_headers.split('\n')
+        for line in accumulated_headers:
             if ':' in line:
                 name, value = [ x.strip() for x in line.split(':', 1) ]
                 L.append((name, value))

__________________________________
Repoze Bugs <b...@bugs.repoze.org>
<http://bugs.repoze.org/issue64>
__________________________________
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to