Commit 78c43c25 authored by Andreas Jung's avatar Andreas Jung

- Collector #2037: fixed broken ACTUAL_URL for '/'

parent 0bd5545b
...@@ -20,6 +20,8 @@ Zope Changes ...@@ -20,6 +20,8 @@ Zope Changes
- Missing import of NotFound in webdav.Resource. - Missing import of NotFound in webdav.Resource.
- Collector #2037: fixed broken ACTUAL_URL for '/'
Zope 2.9.1 (2006/02/25) Zope 2.9.1 (2006/02/25)
Bugs fixed Bugs fixed
......
...@@ -193,7 +193,7 @@ class VirtualHostMonster(Persistent, Item, Implicit): ...@@ -193,7 +193,7 @@ class VirtualHostMonster(Persistent, Item, Implicit):
request['VIRTUAL_URL'] = '/'.join(vup) request['VIRTUAL_URL'] = '/'.join(vup)
# new ACTUAL_URL # new ACTUAL_URL
add = request['ACTUAL_URL'].endswith('/') and '/' or '' add = (path and request['ACTUAL_URL'].endswith('/')) and '/' or ''
request['ACTUAL_URL'] = request['VIRTUAL_URL']+add request['ACTUAL_URL'] = request['VIRTUAL_URL']+add
return return
......
...@@ -59,6 +59,17 @@ class VHMRegressions(unittest.TestCase): ...@@ -59,6 +59,17 @@ class VHMRegressions(unittest.TestCase):
m = self.app.folder.doc.getPhysicalPath m = self.app.folder.doc.getPhysicalPath
self.assertEqual(m(), ('', 'folder', 'doc')) self.assertEqual(m(), ('', 'folder', 'doc'))
def test_actual_url(self):
self.app.folder.manage_addDTMLMethod('index_html', '')
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80/folder/VirtualHostRoot/doc/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], 'http://www.mysite.com/doc/')
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80/folder/VirtualHostRoot/doc')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], 'http://www.mysite.com/doc')
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80/folder/VirtualHostRoot/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], 'http://www.mysite.com/')
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80/folder/VirtualHostRoot')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], 'http://www.mysite.com/')
def gen_cases(): def gen_cases():
for vbase, ubase in ( for vbase, ubase in (
('', 'http://foo'), ('', 'http://foo'),
......
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