MAESTRO: enforce header input validation

This commit is contained in:
Mariusz Banach
2026-02-18 00:52:22 +01:00
parent 8652f04acc
commit f0c33a93f9
5 changed files with 33 additions and 23 deletions

View File

@@ -0,0 +1,13 @@
export const MAX_HEADER_INPUT_BYTES = 1024 * 1024;
export const validateHeaderInput = (value: string): string | null => {
if (value.length > MAX_HEADER_INPUT_BYTES) {
return "Header input exceeds the 1 MB limit.";
}
if (value.trim().length === 0) {
return "Header input cannot be empty.";
}
return null;
};