From: 依云 Date: Tue, 25 Nov 2014 13:45:45 +0000 (+0800) Subject: use the same protocol when redirecting to default host X-Git-Tag: v4.1.0b1~53^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1260%2Fhead;p=thirdparty%2Ftornado.git use the same protocol when redirecting to default host --- diff --git a/tornado/web.py b/tornado/web.py old mode 100644 new mode 100755 index a038265fd..6325f7f91 --- a/tornado/web.py +++ b/tornado/web.py @@ -1845,7 +1845,7 @@ class _RequestDispatcher(httputil.HTTPMessageDelegate): handlers = app._get_host_handlers(self.request) if not handlers: self.handler_class = RedirectHandler - self.handler_kwargs = dict(url="http://" + app.default_host + "/") + self.handler_kwargs = dict(url="%s://%s/" % (self.request.protocol, app.default_host)) return for spec in handlers: match = spec.regex.match(self.request.path)