Fix login if Hydra runs behind HTTP proxy with sub-path location

This commit is contained in:
Christian Kögler 2021-02-07 19:18:29 +01:00
parent d8a5892795
commit 150213cbb3

View file

@ -76,8 +76,8 @@ sub begin :Private {
# XSRF protection: require POST requests to have the same origin.
if ($c->req->method eq "POST" && $c->req->path ne "api/push-github") {
my $referer = $c->req->header('Origin');
$referer //= $c->req->header('Referer');
my $referer = $c->req->header('Referer');
$referer //= $c->req->header('Origin');
my $base = $c->req->base;
die unless $base =~ /\/$/;
$referer .= "/";