1. cherrypy
  2. CherryPy

Commits

Gustavo Picon  committed d3a2652

Cleaning up imports in dispatch.virtualhost

  • Participants
  • Parent commits c601a55
  • Branches cp4

Comments (0)

Files changed (1)

File cherrypy/lib/dispatch/virtualhost.py

View file
  • Ignore whitespace
 import cherrypy
-from cherrypy.lib.dispatch import Dispatcher
+from cherrypy.lib.httputil import urljoin
+from cherrypy.lib.dispatch.object import Dispatcher
 
 
 def VirtualHost(next_dispatcher=Dispatcher(), use_x_forwarded_host=True,
         for "example.com" and "www.example.com". In addition, "Host"
         headers may contain the port number.
     """
-    from cherrypy.lib import httputil
-
     def vhost_dispatch(path_info):
         request = cherrypy.serving.request
         header = request.headers.get
 
         prefix = domains.get(domain, "")
         if prefix:
-            path_info = httputil.urljoin(prefix, path_info)
+            path_info = urljoin(prefix, path_info)
 
         result = next_dispatcher(path_info)