Repository navigation
fix(core): request uncompressed credential responses from reqsign - #8421
Merged
Xuanwo merged 3 commits intoNov 1, 2026
Merged
Conversation
Xuanwo
approved these changes
Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #8418.
Rationale for this change
reqsign sends its credential requests (the GCS token exchange for
credential_path, metadata/STS calls for other services) through the operator'sHttpTransporter, so they use the user's HTTP client. reqsign reads those responses as raw bytes and parses them as JSON; it never checksContent-Encoding.The client in the issue sends
Accept-Encoding: gzipas a default header and turns off reqwest's automatic decompression, because the application handles compression of object data itself. Google's token endpoint honours that header, so reqsign gets a gzip body and fails withfailed to parse token response. The reporter says the same client setup worked on 0.55.What changes are included in this PR?
impl reqsign_core::HttpSend for HttpTransporternow setsAccept-Encoding: identityon the request when reqsign has not set anAccept-Encodingheader itself. reqwest only adds a default header when the request does not already have it, so this header wins over the client's defaultgzip, while ordinary object requests (which don't go throughHttpSend) keep the user's headers.identityis sent, one checks that an explicitAccept-Encodingfrom reqsign is left as is. The first fails without the fix.Tests run locally (from
core/):cargo test -p opendal-core --features reqsign --lib(238 passed)cargo clippy -p opendal-core --features reqsign --all-targets -- -D warningsandcargo fmt -p opendal-core -- --checkReqwestTransportwith a client that hasAccept-Encoding: gzipas a default header, against a local server that returns aContent-Encoding: gzipbody only when gzip is accepted: before the changehttp_sendreturned the compressed bytes, after it returned the plain JSON.I did not test against the real Google token endpoint.
Are there any user-facing changes?
Credential requests made by reqsign through OpenDAL's transport now carry
Accept-Encoding: identityunless reqsign sets the header. Users whose HTTP client requests compressed responses without decoding them can use credential loaders again. No API changes.Breaking changes
AI Usage Statement
HttpSendbridge, write the fix and the unit tests, run the local end-to-end check described above, and draft this description. I reviewed the diff. The behaviour against Google's real token endpoint is inferred from the issue report, not tested.