TinySkin/server/route/middleware.go
2023-09-03 23:19:38 +08:00

15 lines
307 B
Go

package route
import (
"net/http"
"github.com/julienschmidt/httprouter"
)
func warpHJSON(handle httprouter.Handle) httprouter.Handle {
return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
handle(w, r, p)
}
}