Found while triaging #661 (not the cause of that 405 — filing per policy so it isn't lost).
Problem
In the #619 "unsupported encoding" path, src/server.ts forwards the still-encoded body bytes, but the content-encoding header is stripped as hop-by-hop (UPSTREAM_HOP_HEADERS, src/server.ts:208-227). Upstream receives gzip/br/deflate bytes declared as none → 400-class failures.
Also the comment near src/server.ts:1003 ("content-encoding header stays intact") contradicts the actual behavior — headers in UPSTREAM_HOP_HEADERS are stripped on forward.
Expected
Either:
- forward the body decoded (decode → strip header — consistent), or
- forward the raw bytes with
content-encoding preserved on this path.
Repro sketch
Upstream advertises Accept-Encoding: br; client sends content-encoding: gzip body through a path that bili does not decode (unsupported encoding per #619); observe upstream rejecting undeclared binary body.
Priority
Low-medium: only bites clients that send request bodies with encodings bili doesn't decode. Discovered by ework during #661 PR #664 triage; independently confirmed in code reading.
Found while triaging #661 (not the cause of that 405 — filing per policy so it isn't lost).
Problem
In the #619 "unsupported encoding" path,
src/server.tsforwards the still-encoded body bytes, but thecontent-encodingheader is stripped as hop-by-hop (UPSTREAM_HOP_HEADERS, src/server.ts:208-227). Upstream receives gzip/br/deflate bytes declared as none → 400-class failures.Also the comment near
src/server.ts:1003("content-encoding header stays intact") contradicts the actual behavior — headers inUPSTREAM_HOP_HEADERSare stripped on forward.Expected
Either:
content-encodingpreserved on this path.Repro sketch
Upstream advertises
Accept-Encoding: br; client sendscontent-encoding: gzipbody through a path that bili does not decode (unsupported encoding per #619); observe upstream rejecting undeclared binary body.Priority
Low-medium: only bites clients that send request bodies with encodings bili doesn't decode. Discovered by ework during #661 PR #664 triage; independently confirmed in code reading.