12 lines
241 B
Go
12 lines
241 B
Go
package middleware
|
|
|
|
import "net/http"
|
|
|
|
func SetJson(next http.Handler) http.Handler {
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Add("Content-Type", "application/json")
|
|
|
|
next.ServeHTTP(w, r)
|
|
})
|
|
}
|