* @param {string} characters * @returns {boolean}
(characters)
| 750 | * @returns {boolean} |
| 751 | */ |
| 752 | function isValidHTTPToken (characters) { |
| 753 | if (characters.length >= 12) return tokenRegExp.test(characters) |
| 754 | if (characters.length === 0) return false |
| 755 | |
| 756 | for (let i = 0; i < characters.length; i++) { |
| 757 | if (validTokenChars[characters.charCodeAt(i)] !== 1) { |
| 758 | return false |
| 759 | } |
| 760 | } |
| 761 | return true |
| 762 | } |
| 763 | |
| 764 | // headerCharRegex have been lifted from |
| 765 | // https://github.com/nodejs/node/blob/main/lib/_http_common.js |
no outgoing calls
no test coverage detected