#1 2024-12-05 11:59:19

Chaa
Member
Registered: 2011-03-26
Posts: 252

Wrong Content-Encoding header

There is wrong "Content-Encoding: gzip" header when ReturnFile is used (for example, in TMvcRunOnRestServer). In that case server returns uncompressed file with encoding header and browser throws error net::ERR_CONTENT_DECODING_FAILED.

I think problem is in THttpRequestContext.CompressContentAndFinalizeHead.

Variable fContentEncoding reset in function CompressContent, but if ContentStream <> nil then this function is not called, and fContentEncoding contains value from previous response.

I think we must clear fContentEncoding anywhere.

Offline

#2 2024-12-05 13:29:16

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,742
Website

Re: Wrong Content-Encoding header

Offline

Board footer

Powered by FluxBB