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

Malformed response for non Ok statuses when using web_tonic on the server. #1666

Open
cyanic-selkie opened this issue Mar 26, 2024 · 0 comments

Comments

@cyanic-selkie
Copy link

Bug Report

Version

tonic 0.11.0
tonic_web 0.11.0
tonic_web_wasm_client 0.5.1

Platform

Linux zb 6.8.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 16 Mar 2024 17:15:35 +0000 x86_64 GNU/Linux

Description

I switched from using the traefik reverse proxy for the grpc-web translation layer to the tonic_web crate by simply adding the .accept_http1(true) and .layer(GrpcWebLayer::new()) calls to the server builder. When I'm using traefik, everything works fine.

Using tonic_web, when Ok responses are returned, everything works fine. However, when a non Ok status is returned (e.g., Internal or NotFound), I get the following error on the client:

Error: Status { code: Unknown, message: "malformed response", metadata: MetadataMap { headers: {"content-length": "0", "content-type": "application/grpc-web+proto"} }, source: Some(MalformedResponse) }!

I am using the unofficial tonic_web_wasm_client since I couldn't get the tonic_web client working, as the example is outdated, and I couldn't figure out what to use instead of the hyper::Client object. Since it is working with the traefik proxy, I'm guessing the issue is in the new translation layer, not the client crate.

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

No branches or pull requests

1 participant