This commit is contained in:
Tomas Dvorak
2025-11-21 08:44:44 +01:00
parent c941313fd5
commit f5b6f83974
108 changed files with 8642 additions and 5871 deletions
+6 -1
View File
@@ -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)
}