minor content-type fixes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-04-16 17:14:27 +03:00
parent b2b4d6a5a3
commit 145a0f4aa6
2 changed files with 18 additions and 2 deletions

View File

@@ -41,6 +41,13 @@ type httpServer struct {
}
func (h *httpServer) newCodec(ct string) (codec.Codec, error) {
h.RLock()
defer h.RUnlock()
if idx := strings.IndexRune(ct, ';'); idx >= 0 {
ct = ct[:idx]
}
if cf, ok := h.opts.Codecs[ct]; ok {
return cf, nil
}