root: fix middleware exception for outpost

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-07-18 22:10:50 +02:00
parent 322a343c81
commit 538a466090

View file

@ -23,6 +23,11 @@ class SessionMiddleware(UpstreamSessionMiddleware):
return True
host, _, _ = request.get_host().partition(":")
if host == "localhost" and settings.DEBUG:
# Since go does not consider localhost with http a secure origin
# we can't set the secure flag.
user_agent = request.META.get("HTTP_USER_AGENT", "")
if user_agent.startswith("authentik-outpost@"):
return False
return True
return False