(context, value, header, filter, isHeaderNameFilter)
| 33 | const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); |
| 34 | |
| 35 | function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { |
| 36 | if (utils.isFunction(filter)) { |
| 37 | return filter.call(this, value, header); |
| 38 | } |
| 39 | |
| 40 | if (isHeaderNameFilter) { |
| 41 | value = header; |
| 42 | } |
| 43 | |
| 44 | if (!utils.isString(value)) return; |
| 45 | |
| 46 | if (utils.isString(filter)) { |
| 47 | return value.indexOf(filter) !== -1; |
| 48 | } |
| 49 | |
| 50 | if (utils.isRegExp(filter)) { |
| 51 | return filter.test(value); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | function formatHeader(header) { |
| 56 | return header |
no outgoing calls
no test coverage detected