[Zope] VirtualHostMonster and "unpack list of wrong size"
Jo Meder
jo@meder.de
Wed, 23 Oct 2002 02:02:56 +0200
Hi all.
After installing Zope 2.6final (which was rather a rather smooth
transition from 2.5.1, congrats to all involved!) we found that our
current setup exposed a very annoying behaviour.
We have Apache doing the virtual host dance in front of Squid in
accelerator mode to keep the system load low in front of Zope.
Apache is intrumented with the usual Rewrite-Rule a la
RewriteRule /(.*) http://localhost:1234/VirtualHostBase/http/%{HTTP_HOST}:80/cms_root/some_name/VirtualHostRoot/$1 [L,P]
Now there seem to be cases (we tracked most of them to usage of wget as
a user agent) where VirtualHostMonster tries to decode
"www.hostname.tld:80:80". The error occurs when VHM tries to execute
host, port = host.split(':')
Granted the original request is invalid and should at least generate a
warning I'd suggest replacing the cited line by
hostparts = host.split(':')
host = hostparts[0]
port = hostparts[1]
This is not a bugfix since the hostname/port combination is obviously
invalid, but it does add reasonable behaviour along the lines of "be
liberal in what you accept and be conservative in what you send", which
was one of the first lines I memorized when I started learning about
protocols.
Jo.
--
Internetmanufaktur Jo Meder ---------------------- Berlin, Germany
http://www.meder.de/ ------------------- fon: ++49-30-417 17 63 33
Kollwitzstr. 75 ------------------------ fax: ++49-30-417 17 63 45
10435 Berlin --------------------------- mob: ++49-170- 2 98 89 97
Public GnuPG-Key ---------- http://www.meder.de/keys/jo-pubkey.txt