|
|
@ -37,8 +37,8 @@ func DefaultRequestQuery(r *http.Request, v any) error { |
|
|
|
return binding.BindQuery(r.URL.Query(), v) |
|
|
|
return binding.BindQuery(r.URL.Query(), v) |
|
|
|
} |
|
|
|
} |
|
|
|
func DefaultRequestDecoder(r *http.Request, v any) error { |
|
|
|
func DefaultRequestDecoder(r *http.Request, v any) error { |
|
|
|
fmt.Println("request decoder") |
|
|
|
|
|
|
|
codec, ok := CodeForRequest(r, "Content-type") |
|
|
|
codec, ok := CodeForRequest(r, "Content-type") |
|
|
|
|
|
|
|
fmt.Println("request decoder", ok) |
|
|
|
if !ok { |
|
|
|
if !ok { |
|
|
|
return errors.BadRequest("CODEC", fmt.Sprintf("unregister Content-Type: %s", codec)) |
|
|
|
return errors.BadRequest("CODEC", fmt.Sprintf("unregister Content-Type: %s", codec)) |
|
|
|
} |
|
|
|
} |
|
|
|