MCPcopy Create free account
hub / github.com/nodejs/node / isValidContentLengthHeaderValue

Function isValidContentLengthHeaderValue

deps/undici/src/lib/core/request.js:31–44  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

29const invalidPathRegex = /[^\u0021-\u00ff]/
30
31function isValidContentLengthHeaderValue (val) {
32 if (typeof val !== 'string' || val.length === 0) {
33 return false
34 }
35
36 for (let i = 0; i < val.length; i++) {
37 const charCode = val.charCodeAt(i)
38 if (charCode < 48 || charCode > 57) {
39 return false
40 }
41 }
42
43 return true
44}
45
46const kHandler = Symbol('handler')
47const kController = Symbol('controller')

Callers 1

processHeaderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected