We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In our project, we used gRpc-Gateway. But I find, I can't set http header in RPC response. What should we do? Thanks!
The text was updated successfully, but these errors were encountered:
grpc-gateway or go-zero gateway?
Sorry, something went wrong.
I'm not sure. I learn it from this doc "https://go-zero.dev/en/docs/tutorials/gateway/grpc".
gateway.go main code follow:
import ( "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/gateway" "github.com/zeromicro/go-zero/rest/httpx" "github.com/zeromicro/go-zero/zrpc" "google.golang.org/grpc/status" ) func main() { flag.Parse() logx.DisableStat() var c config.Config conf.MustLoad(*configFile, &c) gw := gateway.MustNewServer(c.Gateway) sessionRpcClient := sessionservice.NewSessionService(zrpc.MustNewClient(c.Session)) gw.Use(middleware.SessionMiddleware(sessionRpcClient)) gw.Use(middleware.AuthMiddleware) defer gw.Stop() // 设置错误处理 httpx.SetErrorHandlerCtx(grpcErrorHandlerCtx) fmt.Printf("Starting rpc server at %d...\n", c.Gateway.Port) gw.Start() }
It's need to pull a new request to append the http headers into context metadata.
No branches or pull requests
In our project, we used gRpc-Gateway. But I find, I can't set http header in RPC response.
What should we do? Thanks!
The text was updated successfully, but these errors were encountered: