fpwebproxy TProxyWebModule.ReRouteRequest() doesn't remove "chunked" header
## Summary
fpwebproxy ReRouteRequest() doesn't remove "chunked" header
## System Information
<!-- The more information are provided the easier it is to replicate the bug -->
- **Operating system:** <!-- Windows, Linux (if possible, also name the distro), FreeBSD, Android, ... -->
- **Processor architecture:** <!-- x86, x86-64, ARM, AARCH64, AVR, RISC-V, PowerPC, ... -->
- **Compiler version:** <!-- 3.2, 3.2.2, 3.3, trunk, beta, ... (if possible, give also the git hash) -->
- **Device:** <!-- Computer, Tablet, Mobile, Amiga, Microcontroller, ... -->
## Steps to reproduce
When TProxyWebModule.ReRouteRequest() calls RequestToClient, it (correctly) handles "chunked" transfer encoding. However, when the ContentStream is passed to ClientToResponse(), it is no longer encoded as chunked, BUT the headers are copied verbatim.
This results in an invalid response.
## Example Project
<!-- If possible, please create an example project that exhibits the problematic
behavior, and link to it here in the bug report. -->
## What is the current bug behavior?
The proxy response is invalid (the header indicates 'chunked' but the content isn't encoded that way).
## What is the expected (correct) behavior?
Either encode the response as chunked, or remove the 'chunked' header field.
## Relevant logs and/or screenshots
<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as
it's very hard to read otherwise.
You can also use syntax highlighting for Pascal with: ```pascal the code```
For more information see https://docs.gitlab.com/ee/user/markdown.html -->
## Possible fixes
Remove 'chunked' header. Currently in fpwebproxy, line 255:
if not (HT in [hhContentLength]) then
begin
V:=Trim(ExtractWord(2,N,[':']));
{$IFDEF DEBUGPROXY}Writeln('Returning header: ',N);{$ENDIF}
AResponse.SetCustomHeader(H,V);
end;
Change to:
if not (HT in [hhContentLength]) then
begin
V:=Trim(ExtractWord(2,N,[':']));
{$IFDEF DEBUGPROXY}Writeln('Returning header: ',N);{$ENDIF}
if V <> 'chunked' then
AResponse.SetCustomHeader(H,V);
end;
end;
issue