]> git.proxmox.com Git - pve-http-server.git/commitdiff
request: add missing early return to complete error check
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 4 Jul 2022 09:08:16 +0000 (11:08 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 4 Jul 2022 09:08:19 +0000 (11:08 +0200)
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 <t.lamprecht@proxmox.com>
src/PVE/APIServer/AnyEvent.pm

index 9de623815b2ddfea50a7647e87e51005cc668ff7..877a4e6eea96508badbf990bc3e1c39cacd95b4e 100644 (file)
@@ -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