http-server: fix for api token csrf token check
Do not check any csrf tokens for auth with api tokens. Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
This commit is contained in:
parent
e45f98ef8b
commit
7d11059e2d
@ -104,11 +104,13 @@ sub auth_handler {
|
||||
$isUpload = 1;
|
||||
}
|
||||
|
||||
# we skip CSRF check for file upload, because it is difficult to pass CSRF HTTP headers
|
||||
# with native html forms, and it should not be necessary at all.
|
||||
my $euid = $>;
|
||||
PVE::AccessControl::verify_csrf_prevention_token($username, $token)
|
||||
if !$isUpload && ($euid != 0) && ($method ne 'GET');
|
||||
if (!$api_token) {
|
||||
# we skip CSRF check for file upload, because it is difficult to pass CSRF HTTP headers
|
||||
# with native html forms, and it should not be necessary at all.
|
||||
my $euid = $>;
|
||||
PVE::AccessControl::verify_csrf_prevention_token($username, $token)
|
||||
if !$isUpload && ($euid != 0) && ($method ne 'GET');
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user