Merge remote-tracking branch 'origin/5.3.x' into 6.0.x

This commit is contained in:
William Cheng
2021-07-12 17:11:35 +08:00
3874 changed files with 120282 additions and 21640 deletions

View File

@@ -1 +1,5 @@
6.0.0-SNAPSHOT
<<<<<<< HEAD
6.0.0-SNAPSHOT
=======
5.3.0-SNAPSHOT
>>>>>>> origin/5.3.x

View File

@@ -61,7 +61,15 @@ func NewRouter(routers ...Router) *mux.Router {
// EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code
func EncodeJSONResponse(i interface{}, status *int, headers map[string][]string, w http.ResponseWriter) error {
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
wHeader := w.Header()
if headers != nil {
for key, values := range headers {
for _, value := range values {
wHeader.Add(key, value)
}
}
}
wHeader.Set("Content-Type", "application/json; charset=UTF-8")
if status != nil {
w.WriteHeader(*status)
} else {