You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new at gRPC ecosystem, and I am returning Access-Control-Allow-Origin from the gRPC server as Metadata. But after translate the gRPC response to HTTP response using grpc-gateway, my header becomes Grpc-Metadata-Access-Control-Allow-Origin.
To Reproduce
Return the header as response metadata.
Check if the response metadata is correct.
Call the equivalent REST request through grpc-gateway.
Expected behavior
Do not append the Grpc-Metadata prefix.
Actual Behavior
The grpc server returns the metadata correctly:
/gateway # grpc_cli call app:50051 FindById "id: 1" --protofiles=app.proto
connecting to app:50051
Received initial metadata from server:
access-control-allow-origin : *
age: 0
id: 1
title: "Hello"
status: 10
Rpc succeeded with OK status
But the Grpc-Metadata prefix is apended to the http response header:
Your Environment
GRPC_GATEWAY_VERSION=2.0.0
The text was updated successfully, but these errors were encountered:
Yeah this is the default behaviour for metadata headers returned from the gRPC server. The idea is that the gRPC server should be agnostic to it being exposed as a HTTP server via the gateway.
I hope that helps. If anything is unclear in the documentation, I would love to help you make a contribution to make this clearer to new users. I'm going to close this issue as I believe it has been answered.
🐛 Bug Report
I am new at gRPC ecosystem, and I am returning Access-Control-Allow-Origin from the gRPC server as Metadata. But after translate the gRPC response to HTTP response using grpc-gateway, my header becomes Grpc-Metadata-Access-Control-Allow-Origin.
To Reproduce
Expected behavior
Do not append the Grpc-Metadata prefix.
Actual Behavior
The grpc server returns the metadata correctly:
But the Grpc-Metadata prefix is apended to the http response header:
Your Environment
GRPC_GATEWAY_VERSION=2.0.0
The text was updated successfully, but these errors were encountered: