Changeset - ed117efc9ae9
[Not reviewed]
stable
0 1 0
Mads Kiilerich (mads) - 3 years ago 2022-09-14 08:47:23
mads@kiilerich.com
middleware: fix url_scheme_variable

070b8c39736f accidentally introduced a wrong assumption that
url_scheme_variable is a bool. Fix to only check whether it has been set to
something non-empty.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/config/application.py
Show inline comments
 
@@ -26,25 +26,25 @@ __all__ = ['make_app']
 

	
 

	
 
def wrap_app(app):
 
    """Wrap the TG WSGI application in Kallithea middleware"""
 
    config = app.config
 

	
 
    # we want our low level middleware to get to the request ASAP. We don't
 
    # need any 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 ['url_scheme_variable', 'force_https', 'use_htsts']):
 
    if config.get('url_scheme_variable') or asbool(config.get('force_https')) or asbool(config.get('use_htsts')):
 
        app = HttpsFixup(app, config)
 

	
 
    app = PermanentRepoUrl(app, config)
 

	
 
    # Optional and undocumented wrapper - gives more verbose request/response logging, but has a slight overhead
 
    if asbool(config.get('use_wsgi_wrapper')):
 
        app = RequestWrapper(app, config)
 

	
 
    return app
 

	
 

	
 
def make_app(global_conf, **app_conf):
0 comments (0 inline, 0 general)