func NewProtector(maxBody string, corsOptions cors.Options) func(http.Handler) http.Handler {
	c := cors.New(corsOptions)

	return func(next http.Handler) http.Handler {
		return c.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			// limit request body size
			fire.LimitBody(w, r, int64(fire.DataSize(maxBody)))

			// call next handler
			next.ServeHTTP(w, r)
		}))
	}
}
func NewProtector(maxBody string, corsOptions cors.Options) func(http.Handler) http.Handler {
	c := cors.New(corsOptions)

	return func(next http.Handler) http.Handler {
		return c.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			// limit request body size
			fire.LimitBody(w, r, int64(fire.DataSize(maxBody)))

			// call next handler
			next.ServeHTTP(w, r)
		}))
	}
}
// NewProtector constructs a middleware that implements basic protection measures
// for the passed endpoint. Currently the protector limits the body size
// to a the passed length and automatically handles CORS using the specified
// options.
//
// Note: Place the protector as early as possible in the handler chain.