forked from lix-project/hydra
Fix login if Hydra runs behind HTTP proxy with sub-path location
This commit is contained in:
parent
d8a5892795
commit
150213cbb3
|
@ -76,8 +76,8 @@ sub begin :Private {
|
||||||
|
|
||||||
# XSRF protection: require POST requests to have the same origin.
|
# XSRF protection: require POST requests to have the same origin.
|
||||||
if ($c->req->method eq "POST" && $c->req->path ne "api/push-github") {
|
if ($c->req->method eq "POST" && $c->req->path ne "api/push-github") {
|
||||||
my $referer = $c->req->header('Origin');
|
my $referer = $c->req->header('Referer');
|
||||||
$referer //= $c->req->header('Referer');
|
$referer //= $c->req->header('Origin');
|
||||||
my $base = $c->req->base;
|
my $base = $c->req->base;
|
||||||
die unless $base =~ /\/$/;
|
die unless $base =~ /\/$/;
|
||||||
$referer .= "/";
|
$referer .= "/";
|
||||||
|
|
Loading…
Reference in a new issue