fix request.environ -> request.headers to get HTTP headers from reverse proxy

This commit is contained in:
Stephane Martin 2016-09-05 23:34:15 +02:00
parent d7d8ef6d76
commit 034cc1febd

View file

@ -222,7 +222,7 @@ def create_app(config=None):
@app.before_request @app.before_request
def proxy_auth(): def proxy_auth():
from realms.modules.auth.proxy.models import User as ProxyUser from realms.modules.auth.proxy.models import User as ProxyUser
remote_user = request.environ.get(app.config["AUTH_PROXY_HEADER_NAME"]) remote_user = request.headers.get(app.config["AUTH_PROXY_HEADER_NAME"])
if remote_user: if remote_user:
if current_user.is_authenticated: if current_user.is_authenticated:
if current_user.id == remote_user: if current_user.id == remote_user: