From 4099febef5df2766b136fcd6a2e6b384c7b5a7cd Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 4 Jul 2022 11:08:16 +0200 Subject: [PATCH] request: add missing early return to complete error check While $self->error will immediately send out a 4xx or 5xx response anyhow its still good to cover against possible side effects (e.g., from future code in that branch) on the server and return directly. Note that this is mostly for completeness sake, we already have another check that covers this one for relevant cases in commit 580d540ea907ba15f64379c5bb69ecf1a49a875f. Signed-off-by: Thomas Lamprecht --- src/PVE/APIServer/AnyEvent.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/APIServer/AnyEvent.pm b/src/PVE/APIServer/AnyEvent.pm index 9de6238..877a4e6 100644 --- a/src/PVE/APIServer/AnyEvent.pm +++ b/src/PVE/APIServer/AnyEvent.pm @@ -1578,6 +1578,7 @@ sub push_request_header { # if an '@' comes before the first slash proxy forwarding might consider # the frist part of the url to be part of an authority... $self->error($reqstate, 400, "invalid url"); + return; } $self->{request_count}++; # only count valid request headers