mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-12-16 11:52:58 +03:00
fe8be3701f
Merge in DNS/adguard-home from websvc-config-manager to master Squashed commit of the following: commit 2143b47c6528030dfe059172888fddf9061e42da Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Oct 4 14:50:47 2022 +0300 next: add config manager
17 lines
338 B
Go
17 lines
338 B
Go
package websvc
|
|
|
|
import "net/http"
|
|
|
|
// Middlewares
|
|
|
|
// jsonMw sets the content type of the response to application/json.
|
|
func jsonMw(h http.Handler) (wrapped http.HandlerFunc) {
|
|
f := func(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
h.ServeHTTP(w, r)
|
|
}
|
|
|
|
return http.HandlerFunc(f)
|
|
}
|