1. Wojciech Malinowski
  2. Webware

Source

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

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()