fix(library): reject reserved names (cache, .uploads) with 400 reserved_name (B8)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package media
|
||||
|
||||
import "strings"
|
||||
|
||||
// reservedNames are library names that conflict with system directories.
|
||||
// This is the single source of truth for reserved name validation (B8).
|
||||
var reservedNames = map[string]bool{
|
||||
"cache": true, // CACHE_DIR
|
||||
".uploads": true, // upload session directory
|
||||
".trash": true, // potential future use
|
||||
}
|
||||
|
||||
// IsReservedName reports whether name conflicts with system directories.
|
||||
func IsReservedName(name string) bool {
|
||||
return reservedNames[strings.ToLower(name)]
|
||||
}
|
||||
Reference in New Issue
Block a user