X-Git-Url: https://git.proxmox.com/?p=pve-http-server.git;a=blobdiff_plain;f=src%2FPVE%2FAPIServer%2FAnyEvent.pm;h=24b2002879f1585d1dfbb985d3015553e193d25a;hp=f5653e9be4d18717044055900ae1c57f6225f611;hb=936007ae0241811093155000486da171379c23c2;hpb=b9a7fd54e9f23482e668454001913caa096ecad1 diff --git a/src/PVE/APIServer/AnyEvent.pm b/src/PVE/APIServer/AnyEvent.pm index f5653e9..24b2002 100644 --- a/src/PVE/APIServer/AnyEvent.pm +++ b/src/PVE/APIServer/AnyEvent.pm @@ -293,9 +293,16 @@ sub response { my $code = $resp->code; my $msg = $resp->message || HTTP::Status::status_message($code); - ($msg) = $msg =~m/^(.*)$/m; my $content = $resp->content; + # multiline mode only checks \n for $, so explicitly check for any \n or \r afterwards + ($msg) = $msg =~ m/^(.*)$/m; + if ($msg =~ /[\r\n]/) { + $code = 400; # bad request from user + $msg = HTTP::Status::status_message($code); + $content = ''; + } + if ($code =~ /^(1\d\d|[23]04)$/) { # make sure informational, no content and not modified response send no content $content = "";