mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-17 20:51:19 -08:00
Refuse run ids that could leave the runs folder and stop replacements being read as patterns
AI Assisted
This commit is contained in:
1 parent
b17213322c
commit
0b6a376915
8 files changed
+37
-13
No files matched your search
@@ -242,7 +242,8 @@ export function parseSubmissionPayload(body: string): RunMetrics | null {
|
||||
if (!parsed) return null;
|
||||
|
||||
if (parsed['schema_version'] !== '1.0') return null;
|
||||
if (!isString(parsed['run_id'])) return null;
|
||||
// The id becomes a file name in the runs folder: only the collector's own shape.
|
||||
if (!isString(parsed['run_id']) || !/^run-[A-Za-z0-9-]{1,64}$/.test(parsed['run_id'])) return null;
|
||||
if (!isString(parsed['plan2code_version'])) return null;
|
||||
|
||||
const feedbackRaw = parsed['user_feedback'];
|
||||
|
||||
Reference in new issue
Block a user