Commits

Robert Brewer  committed eeebc0f

Tweaks.

  • Participants
  • Parent commits 7f6cbce

Comments (0)

Files changed (2)

File cherrypy/_cpserver.py

     
     def _start_http(self, httpserver):
         """Start the given httpserver in a new thread."""
+        scheme = "http"
+        if getattr(httpserver, "ssl_certificate", None):
+            scheme = "https"
         bind_addr = self.httpservers[httpserver]
         if isinstance(bind_addr, tuple):
             wait_for_free_port(*bind_addr)
             host, port = bind_addr
             if not host:
                 host = '0.0.0.0'
-            on_what = "http://%s:%s/" % (host, port)
+            on_what = "%s://%s:%s/" % (scheme, host, port)
         else:
             on_what = "socket file: %s" % bind_addr
         
         t.start()
         
         self.wait(httpserver)
-        cherrypy.log("Serving HTTP on %s" % on_what, 'HTTP')
+        cherrypy.log("Serving %s on %s" % (scheme.upper(), on_what), 'HTTP')
     
     def _start_http_thread(self, httpserver):
         """HTTP servers MUST be started in new threads, so that the

File cherrypy/test/test_core.py

         
         if cherrypy.server.protocol_version == "HTTP/1.1":
             # Test RFC-2047-encoded request and response header values
-            self.getPage("/headers/ifmatch",
-                         [('If-Match', '=?utf-8?q?=E2=84=ABngstr=C3=B6m?=')])
+            c = "=E2=84=ABngstr=C3=B6m"
+            self.getPage("/headers/ifmatch", [('If-Match', '=?utf-8?q?%s?=' % c)])
             self.assertBody("u'\\u212bngstr\\xf6m'")
             self.assertHeader("ETag", '=?utf-8?b?4oSrbmdzdHLDtm0=?=')
             
             # Test a *LONG* RFC-2047-encoded request and response header value
-            c = "=E2=84=ABngstr=C3=B6m"
             self.getPage("/headers/ifmatch",
                          [('If-Match', '=?utf-8?q?%s?=' % (c * 10))])
             self.assertBody("u'%s'" % ('\\u212bngstr\\xf6m' * 10))