[pve-devel] [PATCH http-server] Don't override explicit $nocomp with default

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Feb 21 10:47:11 CET 2019


On 2/21/19 10:35 AM, Stoiko Ivanov wrote:
> By making compression configurable the $nocomp flag in response got set to
> the configured (or default) setting, irrespective of the explicitly passed
> value to response.
> 
> This broke (e.g.) noVNC connections
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
> TIL: curl and testssl.sh don't give the complete picture about the working of
> a webinterface... - sorry!
> PVE/APIServer/AnyEvent.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PVE/APIServer/AnyEvent.pm b/PVE/APIServer/AnyEvent.pm
> index 277a1ec..502b824 100755
> --- a/PVE/APIServer/AnyEvent.pm
> +++ b/PVE/APIServer/AnyEvent.pm
> @@ -184,7 +184,7 @@ sub response {
>      $reqstate->{hdl}->timeout_reset();
>      $reqstate->{hdl}->timeout($self->{timeout});
>  
> -    $nocomp = !$self->{compression};
> +    $nocomp //= !$self->{compression};

applied, but followed up to change it to same style as the !accept_gzip
below, makes it a bit easier to get that this is only "allow to force comp off"
but not "force on", IMO.
much thanks for detecting and fixing this before package bump!

>      $nocomp = 1 if !$reqstate->{accept_gzip};
>  
>      my $code = $resp->code;
> 





More information about the pve-devel mailing list