# HG changeset patch # User Mads Kiilerich # Date 1431472608 -7200 # Node ID 15ac6f39f96332ee98407980f2ba64a1a697d6b6 # Parent beeb69476cc4a02b5d5f6f7d024c24b2e17c6ba7 middleware: apply HttpsFixup to Hg/Git operations too (Issue #132) Fix regression from 6a0964373a30. 'Require SSL for vcs operations' might make the protocol operations depend on the protocol type reported by a proxy even though they don't generate URLs. diff -r beeb69476cc4 -r 15ac6f39f963 kallithea/config/middleware.py --- a/kallithea/config/middleware.py Wed May 13 01:16:48 2015 +0200 +++ b/kallithea/config/middleware.py Wed May 13 01:16:48 2015 +0200 @@ -87,15 +87,15 @@ else: app = StatusCodeRedirect(app, [400, 401, 403, 404, 500]) - # Enable https redirects based on HTTP_X_URL_SCHEME set by proxy - if any(asbool(config.get(x)) for x in ['https_fixup', 'force_https', 'use_htsts']): - app = HttpsFixup(app, config) - # we want our low level middleware to get to the request ASAP. We don't # need any pylons stack middleware in them - especially no StatusCodeRedirect buffering app = SimpleHg(app, config) app = SimpleGit(app, config) + # Enable https redirects based on HTTP_X_URL_SCHEME set by proxy + if any(asbool(config.get(x)) for x in ['https_fixup', 'force_https', 'use_htsts']): + app = HttpsFixup(app, config) + app = RequestWrapper(app, config) # logging # Establish the Registry for this application