[ZCM] [ZC] 235/ 2 Comment "VirtualHostMonster broken on Zope 2.5.0"

Collector: Zope Bugs and Patches ... zope-coders@zope.org
Wed, 20 Feb 2002 16:39:51 -0500


Issue #235 Update (Comment) "VirtualHostMonster broken on Zope 2.5.0"
 Status Pending, Zope/bug critical
To followup, visit:
  http://collector.zope.org/Zope/235

==============================================================
= Comment - Entry #2 by LRA on Feb 20, 2002 4:39 pm


Uploaded:  "HTTPRequest.py.patch"
 - http://collector.zope.org/Zope/235/HTTPRequest.py.patch/view
In trying to fix this bug I found out a problem in lib/python/ZPublisher/HTTPRequest.py:

the HTTPRequest.setVirtualRoot() function deals with a non-string argument inconsistently with the way it deals with a string argument.

The included patch explains exactly what this inconsistency is.

By fixing the non-string handling to be consistent with the string handling, the VHM bug disapears, which tells me that this may not be a VHM bug after all...

I've run the utilities/testrunner.py -a test suit after applying this patch and it ran ok, although I suspect that HTTPRequest is not being properly test covered.

________________________________________
= Request - Entry #1 by LRA on Feb 20, 2002 1:03 pm

Get a Zope 2.5.0 and put a VirtualHostMonster on your root folder (give it any id).

Then put a pythonScript called 'theUrl' on your root with the contents:
>>>
return container.REQUEST.URL
<<<

then visit the following url:
http://localhost.localdomain:8080/VirtualHostBase/http/example.org:80/VirtualHostRoot/_vh_zopeRoot/theUrl

It will display:

http://example.org//zopeRoot/theUrl

whereas in Zope 2.4.x it will display

http://example.org/zopeRoot/theUrl

Which is the desired behaviour.

This bug is problematic because the RewriteRule directives that are documented in SiteAcces2 for publishing Zope root on apache folder suddenly don't work anymore (specially the regex based ones).

Also, URLs that don't include the 'http://server' part (such as the ZMI link in Zope default index_html) suddenly start with //zopeRoot, which, to the browser, looks like zopeRoot is a server name (which is correct according to RFC 1808).

==============================================================