refactor: move json related header vars to internal (#1840)
* refactor: move json related header vars to internal * refactor: use header.ContentType
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/zeromicro/go-zero/core/mapping"
|
||||
"github.com/zeromicro/go-zero/rest/internal/encoding"
|
||||
"github.com/zeromicro/go-zero/rest/internal/header"
|
||||
"github.com/zeromicro/go-zero/rest/pathvar"
|
||||
)
|
||||
|
||||
@@ -114,5 +115,5 @@ func ParsePath(r *http.Request, v interface{}) error {
|
||||
}
|
||||
|
||||
func withJsonBody(r *http.Request) bool {
|
||||
return r.ContentLength > 0 && strings.Contains(r.Header.Get(ContentType), ApplicationJson)
|
||||
return r.ContentLength > 0 && strings.Contains(r.Header.Get(header.ContentType), header.ApplicationJson)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user