Open palant opened 1 month ago
@andrewhavck Yes, I got that. I updated #286 to account for the recent changes.
Note that https://github.com/cloudflare/pingora/pull/300/commits/b8ec7aab6fc41bb5d39c5bb1b855219f8f1ac3e7 (correctly) applies to the decompression scenario as well, but it only tests the compression one. My pull request tests both.
What is the problem your feature solves, or the need it fulfills?
When adjusting response headers,
ResponseCompressionCtx
will currently remove theContent-Length
header as the old header does not apply. A potentially presentAccept-Ranges: bytes
header is left untouched however, even though ranged requests no longer make sense.Describe the solution you'd like
Call
resp.insert_header(&ACCEPT_RANGES, HeaderValue::from_static("none"))
when compressing. This will both overwrite any existingAccept-Ranges
header and explicitly indicate to the client that ranged requests are unsupported.Describe alternatives you've considered
N/A
Additional context
Accept-Ranges header spec