Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix outbound http in the Rust SDK (take 2) #1975

Merged
merged 3 commits into from
Oct 28, 2023
Merged

Fix outbound http in the Rust SDK (take 2) #1975

merged 3 commits into from
Oct 28, 2023

Conversation

rylev
Copy link
Collaborator

@rylev rylev commented Oct 27, 2023

This is a subset of the changes from #1902.

It keeps the API for send the same (with a slight change to the trait bounds). The internals are tweaked to fix outgoing requests which were not working when a body was sent.

There still seems to be some bugs in wasmtime-wasi-http that prevent true streaming of outbound request bodies.

Also fixes #1954. @vdice, the issue was that the response had a non-zero content-length header but the body was actually empty. This was fixed by actually returning the body - fixed here.

Signed-off-by: Ryan Levick <[email protected]>
@rylev rylev requested a review from dicej October 27, 2023 16:32
sdk/rust/src/http.rs Outdated Show resolved Hide resolved
Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fixes #1954. @vdice, the issue was that the response had a non-zero content-length header but the body was actually empty. This was fixed by actually returning the body - fixed here.

Thanks @rylev. That was the missing bit for the outbound-http-to-same-app component as well. Can we update its lib.rs to set the type as http::Response<String> in this PR as well?

Signed-off-by: Ryan Levick <[email protected]>
@rylev rylev merged commit 09c7e5c into main Oct 28, 2023
9 checks passed
@rylev rylev deleted the http-fix branch April 24, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Examples: http-rust-outbound-http bugs/updates
3 participants