mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-02 16:28:39 +08:00
feat: set content-type to application/json (#2160)
This commit is contained in:
parent
557383fbbf
commit
4324ddc024
@ -108,6 +108,8 @@ func (s *Server) buildHandler(source grpcurl.DescriptorSource, resolver jsonpb.A
|
||||
timeout := internal.GetTimeout(r.Header, s.timeout)
|
||||
ctx, can := context.WithTimeout(r.Context(), timeout)
|
||||
defer can()
|
||||
|
||||
w.Header().Set(httpx.ContentType, httpx.JsonContentType)
|
||||
if err := grpcurl.InvokeRPC(ctx, source, cli.Conn(), m.RpcPath, internal.BuildHeaders(r.Header),
|
||||
handler, parser.Next); err != nil {
|
||||
httpx.Error(w, err)
|
||||
|
Loading…
Reference in New Issue
Block a user