Commit 340d366e authored by Evan Simpson's avatar Evan Simpson

Merge vhm fix from Zope-2_5-branch

parent 44c4c51c
...@@ -34,7 +34,7 @@ class VirtualHostMonster(Persistent, Item, Implicit): ...@@ -34,7 +34,7 @@ class VirtualHostMonster(Persistent, Item, Implicit):
def set_map(self, map_text, RESPONSE=None): def set_map(self, map_text, RESPONSE=None):
"Set domain to path mappings." "Set domain to path mappings."
lines = split(map_text, '\n') lines = split(map_text, '\n')
self.fixed_map = fixed_map = {} self.fixed_map = fixed_map = {}
self.sub_map = sub_map = {} self.sub_map = sub_map = {}
new_lines = [] new_lines = []
...@@ -49,7 +49,7 @@ class VirtualHostMonster(Persistent, Item, Implicit): ...@@ -49,7 +49,7 @@ class VirtualHostMonster(Persistent, Item, Implicit):
host, path = map(strip, split(line, '/', 1)) host, path = map(strip, split(line, '/', 1))
except: except:
raise 'LineError', 'Needs a slash between host and path' raise 'LineError', 'Needs a slash between host and path'
pp = filter(None, split(path, '/')) pp = filter(None, split(path, '/'))
if pp: if pp:
obpath = pp[:] obpath = pp[:]
if obpath[0] == 'VirtualHostBase': if obpath[0] == 'VirtualHostBase':
...@@ -158,7 +158,6 @@ class VirtualHostMonster(Persistent, Item, Implicit): ...@@ -158,7 +158,6 @@ class VirtualHostMonster(Persistent, Item, Implicit):
# If the directive is on top of the stack, go ahead # If the directive is on top of the stack, go ahead
# and process it right away. # and process it right away.
if at_end: if at_end:
pp = filter(None, pp)
request.setVirtualRoot(pp) request.setVirtualRoot(pp)
del stack[-2:] del stack[-2:]
break break
...@@ -203,7 +202,7 @@ class VirtualHostMonster(Persistent, Item, Implicit): ...@@ -203,7 +202,7 @@ class VirtualHostMonster(Persistent, Item, Implicit):
parents.pop() # I don't belong there parents.pop() # I don't belong there
if len(name) > 1: if len(name) > 1:
request.setVirtualRoot(split(name[1:], '/')) request.setVirtualRoot(name)
else: else:
request.setVirtualRoot([]) request.setVirtualRoot([])
return parents.pop() # He'll get put back on return parents.pop() # He'll get put back on
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.61 $'[11:-2] __version__='$Revision: 1.62 $'[11:-2]
import re, sys, os, urllib, time, whrandom, cgi import re, sys, os, urllib, time, whrandom, cgi
from BaseRequest import BaseRequest from BaseRequest import BaseRequest
...@@ -158,8 +158,8 @@ class HTTPRequest(BaseRequest): ...@@ -158,8 +158,8 @@ class HTTPRequest(BaseRequest):
""" Treat the current publishing object as a VirtualRoot """ """ Treat the current publishing object as a VirtualRoot """
other = self.other other = self.other
if type(path) is type(''): if type(path) is type(''):
path = filter(None, path.split( '/')) path = path.split( '/')
self._script[:] = map(quote, path) self._script[:] = map(quote, filter(None, path))
del self._steps[:] del self._steps[:]
parents = other['PARENTS'] parents = other['PARENTS']
if hard: if hard:
......
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