mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
dev day #99
This commit is contained in:
@@ -57,6 +57,11 @@ func ValidateContentType() gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
if strings.Contains(path, "/rembg/start") {
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
|
||||
// Require JSON for other API endpoints
|
||||
if !strings.Contains(contentType, "application/json") {
|
||||
c.JSON(http.StatusUnsupportedMediaType, gin.H{
|
||||
@@ -127,6 +132,6 @@ func LogSecurityEvent(c *gin.Context, eventType string, details map[string]inter
|
||||
}
|
||||
|
||||
// Log to your logger
|
||||
// logger.Warn("SECURITY_EVENT: type=%s user_id=%d ip=%s path=%s",
|
||||
// logger.Warn("SECURITY_EVENT: type=%s user_id=%d ip=%s path=%s",
|
||||
// event.Type, event.UserID, event.IP, event.Path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user