Commit b56bc07d authored by Andreas Jung's avatar Andreas Jung

- The REQUEST now contains a new entry ACTUAL_URL which contains the

        full URL without query string as it appears within the location bar of
        the browser. The key has been added to provide a single key that is 
        available for vhosted and non-vhosted installations.

      - Collector #1605: VHM did not quote URLs
parent 77e3bb9d
......@@ -46,6 +46,13 @@ Zope Changes
Bugs fixed
- The REQUEST now contains a new entry ACTUAL_URL which contains the
full URL without query string as it appears within the location bar of
the browser. The key has been added to provide a single key that is
available for vhosted and non-vhosted installations.
- Collector #1605: VHM did not quote URLs
- webdav.Resource: during COPY, manage_afterClone was called way
too early, thus the object wasn't bound to the database and
couldn't find a context. Changed to behave the same way as
......
......@@ -8,6 +8,7 @@ from OFS.SimpleItem import Item
from Acquisition import Implicit, aq_inner, aq_parent
from ZPublisher import BeforeTraverse
from zExceptions import BadRequest
from urllib import quote
import os
from AccessRule import _swallow
......@@ -185,11 +186,16 @@ class VirtualHostMonster(Persistent, Item, Implicit):
vh_part = path.pop(0)[1:]
if vh_part:
request['VIRTUAL_URL_PARTS'] = vup = (
request['SERVER_URL'], vh_part, '/'.join(path))
request['SERVER_URL'], vh_part, quote('/'.join(path)))
else:
request['VIRTUAL_URL_PARTS'] = vup = (
request['SERVER_URL'], '/'.join(path))
request['SERVER_URL'], quote('/'.join(path)))
request['VIRTUAL_URL'] = '/'.join(vup)
# new ACTUAL_URL
add = request['ACTUAL_URL'].endswith('/') and '/' or ''
request['ACTUAL_URL'] = request['VIRTUAL_URL']+add
return
vh_used = 1 # Only retry once.
# Try to apply the host map if one exists, and if no
......
......@@ -189,6 +189,9 @@ class BaseRequest:
if response is None: response=self.response
debug_mode=response.debug_mode
# remember path for later use
browser_path = path
# Cleanup the path list
if path[:1]=='/': path=path[1:]
if path[-1:]=='/': path=path[:-1]
......@@ -251,6 +254,7 @@ class BaseRequest:
path.reverse()
request['TraversalRequestNameStack'] = request.path = path
request['ACTUAL_URL'] = request['URL'] + quote(browser_path)
# Set the posttraverse for duration of the traversal here
self._post_traverse = post_traverse = []
......
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