mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-20 14:12:59 +03:00
The new !upstream.ok error path copies upstream.headers (which can carry a content-length/content-encoding/transfer-encoding for the ORIGINAL upstream body) onto the freshly re-serialized JSON error Response, causing a byte-length mismatch. Route the headers through stripStaleEncodingHeaders() before serializing the error body, and add a regression test that mocks an upstream Response with an explicit content-length header. Co-authored-by: OPX-Aminul <305739020+OPX-Aminul@users.noreply.github.com>