feat(rest): wrap catalog responses in HttpResponse - #2996
Open
plusplusjiajia wants to merge 1 commit into
Open
Conversation
plusplusjiajia
force-pushed
the
fix/rest-followup-nits
branch
from
August 14, 2026 06:20
75a8a7e to
ec97576
Compare
plusplusjiajia
force-pushed
the
fix/rest-followup-nits
branch
from
August 14, 2026 06:58
ec97576 to
ab0be9a
Compare
plusplusjiajia
marked this pull request as ready for review
August 14, 2026 09:44
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 #2993.
What changes are included in this PR?
#2838 added
HttpRequest; responses were still unwrapped. This adds the counterpart.response.rs(mirroringrequest.rs) withHttpResponse { status, headers, body }.query_catalogandpost_formreturn it, soreqwest::Responseno longer appears outsideHttpClient—catalog.rsdoesn't even import it any more.deserialize_catalog_responseanddeserialize_unexpected_catalog_errorare no longerasync: the body is already read.post_formreturnsHttpResponseinstead of(StatusCode, Vec<u8>). Breaking, but that method landed in #2838 and hasn't been released.The body is buffered as a
Vec<u8>(notbytes::Bytes, to keep another third-party type out of the public API), andDebugis hand-written since a token exchange answers with a credential in the body.Buffering is eager, so a body-read failure now surfaces on paths that ignored the body before — a
drop_tablethat gets200and then loses the connection used to returnOk(())and now errors. Narrow window, and failing loudly seems right, but it is a semantic change.HEAD/204/304are unaffected.Also cleared this crate's
cargo docwarnings, which aren't a CI gate today — including a danglingSelf::without_sessionlink left by the rename in #2994.Are these changes tested?
76 tests. New ones pin
HttpResponseround-tripping status/headers/body through a real response,Debugholding back the body and sensitive headers, the unexpected-status error carrying status/headers/body, and a truncated-body error naming its URL — the last three were previously unpinned.