(value, invalidChars)
| 36 | const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g'); |
| 37 | |
| 38 | function sanitizeValue(value, invalidChars) { |
| 39 | if (utils.isArray(value)) { |
| 40 | return value.map((item) => sanitizeValue(item, invalidChars)); |
| 41 | } |
| 42 | |
| 43 | return trimSPorHTAB(String(value).replace(invalidChars, '')); |
| 44 | } |
| 45 | |
| 46 | export const sanitizeHeaderValue = (value) => |
| 47 | sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS); |
no test coverage detected