proxy-wasm-rust-sdk icon indicating copy to clipboard operation
proxy-wasm-rust-sdk copied to clipboard

use dispatch_grpc_call function how to add http/2 header?

Open pi-pi-miao opened this issue 1 year ago • 1 comments

fn dispatch_grpc_call(
    &self,
    upstream_name: &str,
    service_name: &str,
    method_name: &str,
    initial_metadata: Vec<(&str, &[u8])>,
    message: Option<&[u8]>,
    timeout: Duration,
) -> Result<u32, Status> {
    hostcalls::dispatch_grpc_call(
        upstream_name,
        service_name,
        method_name,
        initial_metadata,
        message,
        timeout,
    )
}

in istio wasmplugin the dispatch_grpc_call cannot add grpc header, resulting in the other side sidcar or no sidecar environment tonic grpc as server can not parse

pi-pi-miao avatar Sep 09 '24 03:09 pi-pi-miao

gRPC metadata is transmitted as HTTP/2 headers, so you should be able to add gRPC headers via initial_metadata.

PiotrSikora avatar Oct 19 '24 15:10 PiotrSikora