# HG changeset patch # User Aurélien Campéas # Date 1707128247 -3600 # Mon Feb 05 11:17:27 2024 +0100 # Node ID 58b683d25468b278c7e704c63b6e452abe7c2eed # Parent 1f5e47166ed37f4128504c8d365dbfaba897b3fe wsgi: drop the (now unused) proxyfix thing and use the nosecurity context The nosecurity middleware will put all users as admins. diff --git a/tshistory_refinery/wsgi.py b/tshistory_refinery/wsgi.py --- a/tshistory_refinery/wsgi.py +++ b/tshistory_refinery/wsgi.py @@ -1,26 +1,9 @@ +from tshistory.http.util import nosecurity + from tshistory_refinery.webapp import ( httpapi, make_app ) - -class ReverseProxied(object): - def __init__(self, app): - self.app = app - - def __call__(self, environ, start_response): - script_name = environ.get('HTTP_X_SCRIPT_NAME', '') - if script_name: - environ['SCRIPT_NAME'] = script_name - path_info = environ['PATH_INFO'] - if path_info.startswith(script_name): - environ['PATH_INFO'] = path_info[len(script_name):] - - scheme = environ.get('HTTP_X_SCHEME', '') - if scheme: - environ['wsgi.url_scheme'] = scheme - return self.app(environ, start_response) - - app = make_app(httpapi=httpapi) -app.wsgi_app = ReverseProxied(app.wsgi_app) +app.wsgi_app = nosecurity(app.wsgi_app)