lazy codec init
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
7dd1dfbff6
commit
416d494e50
11
handler.go
11
handler.go
@ -97,11 +97,6 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
h.errorHandler(ctx, nil, w, r, fmt.Errorf("path must starts with /"), http.StatusBadRequest)
|
h.errorHandler(ctx, nil, w, r, fmt.Errorf("path must starts with /"), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cf, err := h.newCodec(ct)
|
|
||||||
if err != nil {
|
|
||||||
h.errorHandler(ctx, nil, w, r, err, http.StatusBadRequest)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
matches := make(map[string]interface{})
|
matches := make(map[string]interface{})
|
||||||
|
|
||||||
@ -166,6 +161,12 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cf, err := h.newCodec(ct)
|
||||||
|
if err != nil {
|
||||||
|
h.errorHandler(ctx, nil, w, r, err, http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var argv, replyv reflect.Value
|
var argv, replyv reflect.Value
|
||||||
|
|
||||||
// Decode the argument value.
|
// Decode the argument value.
|
||||||
|
Loading…
Reference in New Issue
Block a user