李伟乐 2 years ago
parent fcf1efdaa5
commit 0e5a03ac30
  1. 2
      transport/http/codec.go

@ -88,7 +88,7 @@ func DefaultErrorEncoder(w http.ResponseWriter, r *http.Request, err error) {
func CodeForRequest(r *http.Request, name string) (encoding.Codec, bool) { func CodeForRequest(r *http.Request, name string) (encoding.Codec, bool) {
for _, accept := range r.Header[name] { for _, accept := range r.Header[name] {
a := httputil.ContentSubtype(accept) a := httputil.ContentSubtype(accept)
fmt.Println("aaa", a) fmt.Println("aaa", name, a)
codec := encoding.GetCodec(a) codec := encoding.GetCodec(a)
if codec != nil { if codec != nil {
return codec, true return codec, true

Loading…
Cancel
Save