李伟乐 2 years ago
parent 97952f7dfe
commit 55542c507c
  1. 1
      transport/http/codec.go

@ -87,6 +87,7 @@ func DefaultErrorEncoder(w http.ResponseWriter, r *http.Request, err error) {
_, _ = w.Write(body)
}
func CodeForRequest(r *http.Request, name string) (encoding.Codec, bool) {
fmt.Printf("rr%+v\n", r.Header)
for _, accept := range r.Header[name] {
a := httputil.ContentSubtype(accept)
fmt.Println(name, a)

Loading…
Cancel
Save