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