VirtualHostMonster does not work with IPv6 named hosts

Bug #699865 reported by Łukasz Nowak on 2011-01-07
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Medium
Unassigned

Bug Description

VirtualHostMonster does not work with IPv6 named hosts.

In case of such rewrite configuration:

RewriteRule (.*) http://10.0.243.129:9280/VirtualHostBase/https/[%{SERVER_ADDR}]:4080$1 [L,P]

When SERVER_ADDR is fd00::74ba VirtualHostMonster dies with:

Traceback (most recent call last):
  File "/eggs/Zope2-2.12.14-py2.6-linux-x86_64.egg/ZPublisher/BeforeTraverse.py", line 145, in __call__
    meth(*(container, request, None)[:args])
  File "/eggs/Zope2-2.12.14-py2.6-linux-x86_64.egg/Products/SiteAccess/VirtualHostMonster.py", line 154, in __call__
    host, port = host.split(':')
ValueError: too many values to unpack

This is because IPv6 addresses contain ":" in them.

Łukasz Nowak (ionowaklukasz) wrote :

I "fixed" this issue by simply extending analysis of given address to being able to survive having semicolons in ip address and assuming that last part of address is a port, but only if it is integer, otherwise it is treat as address.

Hanno Schlichting (hannosch) wrote :

I'd be surprised if this is the only place that cannot deal with IPv6 addresses in Zope2. But we should start adding this new feature at some point...

Changed in zope2:
importance: Undecided → Medium
status: New → Confirmed
Łukasz Nowak (ionowaklukasz) wrote :

I uploaded patch and a test.
All test are passing for bin/test Products.SiteAccess

I am ready for your comments.

REgards,
Luke

Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers