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

Setting gRPC status in http response #148

Closed
wagenet opened this issue Apr 14, 2022 · 3 comments · Fixed by #248
Closed

Setting gRPC status in http response #148

wagenet opened this issue Apr 14, 2022 · 3 comments · Fixed by #248

Comments

@wagenet
Copy link

wagenet commented Apr 14, 2022

Is this possible? It looks like the underlying interface may support it, but it doesn’t seem to be public.

@juanmolle
Copy link

Do we need to expose? maybe instead of return -1 https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/master/src/hostcalls.rs#L721 we can map http code to the closest grpc code

@juanmolle
Copy link

@PiotrSikora let us know what you think about this please

PiotrSikora added a commit to PiotrSikora/proxy-wasm-rust-sdk that referenced this issue Jul 18, 2024
Note that some hosts (e.g. Envoy v1.31+) already map HTTP status codes
from send_http_response() to gRPC status codes, when talking with gRPC
clients, so this API is needed only when more control is needed.

Fixes proxy-wasm#148.

Signed-off-by: Piotr Sikora <[email protected]>
PiotrSikora added a commit to PiotrSikora/proxy-wasm-rust-sdk that referenced this issue Jul 19, 2024
Note that some hosts (e.g. Envoy v1.31+) already map HTTP status codes
from send_http_response() to gRPC status codes, when talking with gRPC
clients, so this API is needed only when more control is needed.

Fixes proxy-wasm#148.

Signed-off-by: Piotr Sikora <[email protected]>
@PiotrSikora
Copy link
Member

This should be fixed in #248.

Note that Envoy doesn't support sending gRPC messages using sendLocalReply() calls, and it automatically changes HTTP responses to gRPC errors when talking with gRPC clients, so this is limited to emitting gRPC error responses, and not for producing valid gRPC responses.

antonengelhardt pushed a commit to antonengelhardt/proxy-wasm-rust-sdk that referenced this issue Oct 23, 2024
…y-wasm#248)

Note that some hosts (e.g. Envoy v1.31+) already map HTTP status codes
from send_http_response() to gRPC status codes, when talking with gRPC
clients, so this API is needed only when more control is needed.

Fixes proxy-wasm#148.

Signed-off-by: Piotr Sikora <[email protected]>
mswaagman-godaddy pushed a commit to mswaagman-godaddy/proxy-wasm-rust-sdk that referenced this issue Nov 27, 2024
…y-wasm#248)

Note that some hosts (e.g. Envoy v1.31+) already map HTTP status codes
from send_http_response() to gRPC status codes, when talking with gRPC
clients, so this API is needed only when more control is needed.

Fixes proxy-wasm#148.

Signed-off-by: Piotr Sikora <[email protected]>
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 a pull request may close this issue.

3 participants