schema: allow legal path characters and reject only real traversal
ci/woodpecker/push/main Pipeline was successful

Accept a double dot inside a file name and '::' in a module path; reject only an
absolute, drive, UNC or backslash path, duplicate separators, and '.'/'..'
path segments. This matches the loader and avoids over-rejecting legal files.
This commit is contained in:
cflmy committed 2026-11-25 11:40:22 +08:00
1 parent 7064c5f22c
commit e0645f376b
1 file changed
+1 -1
+1 -1
View File
@@ -137,7 +137,7 @@
"relative_path": { "relative_path": {
"type": "string", "type": "string",
"minLength": 1, "minLength": 1,
"pattern": "^(?!/)(?!.*::)(?!.*(^|/)\\.\\.?(/|$))(?![A-Za-z]:)(?!.*\\\\)(?!.*//).*$" "pattern": "^(?!/)(?![A-Za-z]:)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.\\.?(?:/|$)).*$"
}, },
"source_digest": {"type": "string", "pattern": "^[0-9a-f]{64}$"}, "source_digest": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"source": {"type": "string"}, "source": {"type": "string"},