Log message for revision 66150:
  - Collector #2037: fixed broken ACTUAL_URL for '/'
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/SiteAccess/VirtualHostMonster.py
  U   Zope/trunk/lib/python/Products/SiteAccess/tests/testVirtualHostMonster.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt  2006-03-24 12:52:47 UTC (rev 66149)
+++ Zope/trunk/doc/CHANGES.txt  2006-03-24 12:53:54 UTC (rev 66150)
@@ -202,6 +202,8 @@
 
     Bugs Fixed
 
+      - Collector #2037: fixed broken ACTUAL_URL for '/'
+
       - Missing import of NotFound in webdav.Resource
 
       - Collector #1819: fixed method signature of

Modified: Zope/trunk/lib/python/Products/SiteAccess/VirtualHostMonster.py
===================================================================
--- Zope/trunk/lib/python/Products/SiteAccess/VirtualHostMonster.py     
2006-03-24 12:52:47 UTC (rev 66149)
+++ Zope/trunk/lib/python/Products/SiteAccess/VirtualHostMonster.py     
2006-03-24 12:53:54 UTC (rev 66150)
@@ -200,7 +200,7 @@
                     request['VIRTUAL_URL'] = '/'.join(vup)
 
                     # 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
 
                 return

Modified: 
Zope/trunk/lib/python/Products/SiteAccess/tests/testVirtualHostMonster.py
===================================================================
--- Zope/trunk/lib/python/Products/SiteAccess/tests/testVirtualHostMonster.py   
2006-03-24 12:52:47 UTC (rev 66149)
+++ Zope/trunk/lib/python/Products/SiteAccess/tests/testVirtualHostMonster.py   
2006-03-24 12:53:54 UTC (rev 66150)
@@ -59,6 +59,17 @@
         m = self.app.folder.doc.getPhysicalPath
         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():
     for vbase, ubase in (
         ('', 'http://foo'),

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to