fix(evobgp): update header handling in evobgpProxyRoutes to preserve content-encoding
Publish Docker image / build-and-push (push) Successful in 1m45s

- Modified header processing to retain content-encoding, ensuring proper handling of gzip responses from upstream servers.
- Added comments for clarity on the importance of this change to avoid issues with client response interpretation.

Made-with: Cursor
This commit is contained in:
2026-04-08 00:13:10 +07:00
parent 3e0c968e7f
commit e99700a916
+3 -1
View File
@@ -79,7 +79,9 @@ function createEvobgpProxy({ logger = console } = {}) {
const clientReq = lib.request(opts, (clientRes) => { const clientReq = lib.request(opts, (clientRes) => {
res.status(clientRes.statusCode); res.status(clientRes.statusCode);
const skip = new Set(['connection', 'transfer-encoding', 'content-encoding']); // Не отбрасываем content-encoding: иначе upstream может отдать gzip-тело,
// а клиент не узнает, что его нужно распаковать (в браузере будет «мусор»).
const skip = new Set(['connection', 'transfer-encoding']);
Object.keys(clientRes.headers).forEach((k) => { Object.keys(clientRes.headers).forEach((k) => {
if (!skip.has(k.toLowerCase())) { if (!skip.has(k.toLowerCase())) {
res.setHeader(k, clientRes.headers[k]); res.setHeader(k, clientRes.headers[k]);