fix: backend error interceptor
This commit is contained in:
@@ -19,18 +19,13 @@ package middleware
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
errorinterceptor "github.com/jkaninda/goma-gateway/pkg/errorinterceptor"
|
||||
"github.com/jkaninda/goma-gateway/pkg/logger"
|
||||
"net/http"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
type BlockCommon struct {
|
||||
ErrorInterceptor errorinterceptor.ErrorInterceptor
|
||||
}
|
||||
|
||||
// BlockExploitsMiddleware Middleware to block common exploits
|
||||
func (blockCommon BlockCommon) BlockExploitsMiddleware(next http.Handler) http.Handler {
|
||||
func BlockExploitsMiddleware(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// Patterns to detect SQL injection attempts
|
||||
sqlInjectionPattern := regexp.MustCompile(sqlPatterns)
|
||||
|
||||
Reference in New Issue
Block a user