[pve-devel] [PATCH http-server v2] http: support Content-Encoding=deflate

Friedrich Weber f.weber at proxmox.com
Thu Apr 18 10:43:04 CEST 2024


On 17/04/2024 13:31, Maximiliano Sandoval wrote:
> [...]
> -	$headers->{'Accept-Encoding'} = 'gzip' if ($reqstate->{accept_gzip} && $self->{compression});
> +	if ($self->{compression}) {
> +	    if ($reqstate->{accept_deflate} && $reqstate->{accept_gzip}) {
> +		$headers->{'Accept-Encoding'} = 'gzip, deflate' if $reqstate->{accept_deflate};

Isn't this post-if redundant because we only enter the block if
$reqstate->{accept_deflate}?

> +	    } elsif ($reqstate->{accept_gzip}) {
> +		$headers->{'Accept-Encoding'} = 'gzip' if $reqstate->{accept_gzip};

same here?

> +	    } elsif ($reqstate->{accept_deflate}) {
> +		$headers->{'Accept-Encoding'} = 'deflate' if $reqstate->{accept_gzip};
> +	    }

Is this correct (accept_deflate in the elsif, accept_gzip in the
post-if)? Do we need a post-if here?




More information about the pve-devel mailing list