mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-24 17:36:47 +08:00
Fix: go restful api tests (#17247)
This commit is contained in:
@@ -105,7 +105,7 @@ func (h *MemoryHandler) CreateMemory(c *gin.Context) {
|
||||
}
|
||||
|
||||
// Validate required field: name
|
||||
if req.Name == "" {
|
||||
if strings.TrimSpace(req.Name) == "" {
|
||||
common.ResponseWithCodeData(c, common.CodeArgumentError, nil, "name is required")
|
||||
return
|
||||
}
|
||||
@@ -892,8 +892,10 @@ func isArgumentError(msg string) bool {
|
||||
// Define list of argument error prefixes
|
||||
// Matches Python ArgumentException error messages
|
||||
argumentErrorPrefixes := []string{
|
||||
"memory name cannot be empty", // Memory name cannot be empty
|
||||
"memory name cannot be empty", // Python: "Memory name cannot be empty or whitespace."
|
||||
"name cannot be empty", // ValidateName trimmed-empty case
|
||||
"memory name exceeds limit", // Memory name exceeds limit
|
||||
"name length is", // ValidateName exceeds limit
|
||||
"memory type must be a list", // memory_type must be a list
|
||||
"memory type is not supported", // Unsupported memory_type
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user