Commits

Robert Brewer committed dfba70d

Removed app.guess_abs_path. Use cherrypy.url(script_name=app.script_name) instead.

Comments (0)

Files changed (2)

cherrypy/__init__.py

                     import socket
                     host = socket.gethostname()
                 port = server.socket_port
-                if (port in (443, 8443) or server.ssl_certificate):
+                if server.ssl_certificate:
                     scheme = "https"
                     if port != 443:
                         host += ":%s" % port

cherrypy/_cptree.py

             if namespace in self.namespaces:
                 self.namespaces[namespace](atoms[1], v)
     
-    def guess_abs_path(self):
-        """Guess the absolute URL from server.socket_host and script_name.
-        
-        When inside a request, the abs_path can be formed via:
-            cherrypy.request.base + (cherrypy.request.app.script_name or "/")
-        
-        However, outside of the request we must guess, hoping the deployer
-        set socket_host and socket_port correctly.
-        """
-        port = cherrypy.server.socket_port
-        if port in (443, 8443):
-            scheme = "https://"
-        else:
-            scheme = "http://"
-        host = cherrypy.server.socket_host
-        if port != 80:
-            host += ":%s" % port
-        return scheme + host + (self.script_name or "/")
-    
     def wsgiapp(self, environ, start_response):
         # This is here instead of __call__ because it's really hard
         # to overwrite special methods like __call__ per instance.