Xuanwo opened a new pull request, #9096: URL: https://github.com/apache/opendal/pull/9096
# Which issue does this PR close? Refs #5070. # Rationale for this change GCS can decompress a stored gzip object when serving a JSON media GET. On a version of the request that triggers decompression, GCS can ignore the requested byte range and omit `Content-Length`. OpenDAL still sees the stored length from `stat`, and both full and ranged reads can fail before consuming the response body. # What changes are included in this PR? Set `Accept-Encoding: gzip` on JSON media GETs so GCS serves the stored representation. A request-builder test covers full and ranged reads. # Are there any user-facing changes? With the default native Rust transport, full reads return stored gzip bytes and ranges address offsets in those bytes. On real GCS, `stat` reported 64 bytes for a gzip object containing 592 bytes of text. Without the header, full and ranged GETs both returned 200 with 592 decompressed bytes and OpenDAL reported `Unexpected`. With the header, `read` returned the exact 64 stored bytes and `range(5..13)` returned the expected eight bytes with `206 Partial Content`. Removing the header on the same object reproduced the failure. A `no-transform` gzip object and an ordinary plaintext object passed both reads with and without the change. If another dependency enables `reqwest/gzip`, the default client can still transparently decompress the response. Both reads failed in that configuration. Supplying a client built with `.no_gzip()` restored both reads in the same build. Runtime verification covered native Rust; browser and Node.js behavior remain unverified. # Breaking changes # AI Usage Statement - pi, Sol (xhigh) implemented the change and verified the native GCS behavior and client configurations. - pi, Astra (high) coordinated the investigation and checked the evidence and final scope. - pi, SWE-2 (high) independently reviewed the patch and its verification. - pi, Gemini (high) drafted the PR description. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
