Commit 42d8780f authored by Dietmar Maurer's avatar Dietmar Maurer

fix proxy loop assertion

parent 2164733e
...@@ -462,21 +462,21 @@ sub handle_api2_request { ...@@ -462,21 +462,21 @@ sub handle_api2_request {
$rpcenv->set_user(undef); # clear after request $rpcenv->set_user(undef); # clear after request
if ($res->{proxy}) { if (my $host = $res->{proxy}) {
if ($self->{trusted_env}) { if ($self->{trusted_env}) {
$self->error($reqstate, HTTP_INTERNAL_SERVER_ERROR, "proxy not allowed"); $self->error($reqstate, HTTP_INTERNAL_SERVER_ERROR, "proxy not allowed");
return; return;
} }
if ($r->header('PVEDisableProxy')) { if ($host ne 'localhost' && $r->header('PVEDisableProxy')) {
$self->error($reqstate, HTTP_INTERNAL_SERVER_ERROR, "proxy loop detected"); $self->error($reqstate, HTTP_INTERNAL_SERVER_ERROR, "proxy loop detected");
return; return;
} }
$res->{proxy_params}->{tmpfilename} = $reqstate->{tmpfilename} if $upload_state; $res->{proxy_params}->{tmpfilename} = $reqstate->{tmpfilename} if $upload_state;
$self->proxy_request($reqstate, $clientip, $res->{proxy}, $method, $self->proxy_request($reqstate, $clientip, $host, $method,
$r->uri, $auth->{ticket}, $auth->{token}, $res->{proxy_params}); $r->uri, $auth->{ticket}, $auth->{token}, $res->{proxy_params});
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment