[Zope-dev] Re: bug in VirtualHostMonster in 2.5.0

Leonardo Rochael Almeida leo@hiper.com.br
22 Feb 2002 18:37:01 -0300


The handling of string and non-string arguments in
HTTPRequest.setVirtualRoot() is indeed inconsistent, but it's obviously
possible to fix the double-root-slash problem by changing the way
VirtualHostMonster calls that method.

Actually, the difference in VirtualHostMonster.__call__ between both
versions is exactly that the new version does there what my patch does
inside HTTPRequest.setVirtualRoot, which is to filter all empty elements
out of the manipulated path before actually setting the virtual root.
Both fixes can be applied at the same time.

I'll even go out on a limb and say that I think my fix is a little more
correct in which it makes the behaviour of setVirtualRoot consistent but
the VHM fix is arguably safer, since it potentially causes less
"interference" :-). Of course, my patch could make setVirtualRoot
consistently wrong :-) but this is something only ZC folks could tell.

Cheers, Leo

On Thu, 2002-02-21 at 21:38, Adam Manock wrote:
> I tried out version 1.6 of:
> http://cvs.zope.org/Zope/lib/python/Products/SiteAccess/VirtualHostMonster.py
> dated 2002/02/15 21:20:33
> 
> It works!!
> 
> I got the correct:
> http://example.org/zopeRoot/p_/ZopeButton
> link on the page when I pointed my browser at:
> http://localhost:8080/VirtualHostBase/http/example.org:80/VirtualHostRoot/_vh_zopeRoot/
> 
> I found no new versions of :
> http://cvs.zope.org/Zope/lib/python/ZPublisher/HTTPRequest.py
> in CVS added since 2.5.0 release.
> 
> So it's fixed, but.....
> Which fix??? Leo's, or the one in CVS??
> The VirtualHostMonster.py mods are obviously less likely to break other 
> stuff, even if it may be "better" to fix the bug in HTTPRequest.py
> 
> "By fixing the non-string handling to be consistent with the string 
> handling, the VHM bug disapears"
>                  Thanks Leo
> 
> Fri Feb 15 21:19:42 2002 UTC (6 days, 3 hours ago) by evan
> "Fix bugs with _vh_ and empty paths"
>                  Thanks Evan
> 
> Gotta love the OSS community....
> 
> What? You mean not only is the bug fixed, but now I have to choose which of 
> the different ways of fixing it I want?

-- 
Ideas don't stay in some minds very long because they don't like
solitary confinement.