Files
schisandra-album-cloud-micr…/common/middleware/unsigned_callback_middleware.go
2024-12-24 00:38:41 +08:00

15 lines
496 B
Go

package middleware
import (
"net/http"
"schisandra-album-cloud-microservices/common/errors"
"schisandra-album-cloud-microservices/common/xhttp"
)
func UnsignedCallbackMiddleware() func(w http.ResponseWriter, r *http.Request, next http.Handler, strict bool, code int) {
return func(w http.ResponseWriter, r *http.Request, next http.Handler, strict bool, code int) {
xhttp.JsonBaseResponseCtx(r.Context(), w, errors.New(http.StatusForbidden, "Unsigned callback not allowed"))
return
}
}