minor content-type fixes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-04-16 17:04:40 +03:00
parent 668e034041
commit 8eeab44898

View File

@ -259,7 +259,7 @@ func (g *grpcServer) handler(srv interface{}, stream grpc.ServerStream) (err err
// timeout for server deadline // timeout for server deadline
to, ok := md.Get("timeout") to, ok := md.Get("timeout")
if ok { if ok {
md.Del("x-content-type") md.Del("timeout")
} }
// get content type // get content type
@ -549,6 +549,10 @@ func (g *grpcServer) newCodec(ct string) (codec.Codec, error) {
g.RLock() g.RLock()
defer g.RUnlock() defer g.RUnlock()
if idx := strings.IndexRune(ct, ';'); idx >= 0 {
ct = ct[:idx]
}
if c, ok := g.opts.Codecs[ct]; ok { if c, ok := g.opts.Codecs[ct]; ok {
return c, nil return c, nil
} }