refactor: Enhance type sanitization for model creation to improve security

This commit is contained in:
wizardchen
2025-11-26 22:30:12 +08:00
parent 530e344e8a
commit a162b6e7c2
+1 -1
View File
@@ -97,7 +97,7 @@ func (h *ModelHandler) CreateModel(c *gin.Context) {
model := &types.Model{
TenantID: tenantID,
Name: secutils.SanitizeForLog(req.Name),
Type: req.Type,
Type: types.ModelType(secutils.SanitizeForLog(string(req.Type))),
Source: req.Source,
Description: secutils.SanitizeForLog(req.Description),
Parameters: req.Parameters,