mirror of
https://github.com/mgeeky/decode-spam-headers.git
synced 2026-06-26 06:47:40 +02:00
MAESTRO: enforce header input validation
This commit is contained in:
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user