GoAsWebServer/web/middleware.go

18 lines
352 B
Go
Raw Permalink Normal View History

2022-08-03 22:49:52 +02:00
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)
}
}