GoAsWebServer/web/middleware.go
2022-08-03 22:49:52 +02:00

18 lines
352 B
Go

package web
import "net/http"
func WithAuth(f http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// TODO check request auth
f(w, r)
}
}
func WithCompression(f http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// TODO wrap writter in compressor
f(w, r)
}
}