refactor: Sanitize log inputs to prevent injection attacks

This commit is contained in:
wizardchen
2025-11-25 22:19:41 +08:00
parent 2f45bf7d86
commit bf35a2861c
10 changed files with 82 additions and 41 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ func (h *ChunkHandler) GetChunkByIDOnly(c *gin.Context) {
return
}
logger.Infof(ctx, "Retrieving chunk by ID, chunk ID: %s, tenant ID: %d", chunkID, tenantID)
logger.Infof(ctx, "Retrieving chunk by ID, chunk ID: %s, tenant ID: %d", secutils.SanitizeForLog(chunkID), tenantID)
// Get chunk by ID
chunk, err := h.service.GetChunkByID(ctx, chunkID)