Source

Webware / WebKit / Testing / URL / vhosts / __init__.py

Full commit
import os
from WebKit.URLParser import URLParser


class VHostParser(URLParser):

    def parseHook(self, trans, requestPath, app, hook):
        host = trans.request().environ()['HTTP_HOST']
        hook.parse(trans, '/%s%s' % (host, requestPath), app)

urlParserHook = VHostParser()