MCPcopy Index your code
hub / github.com/nodejs/node / isValidContentLengthHeaderValue

Function isValidContentLengthHeaderValue

deps/undici/undici.js:2718–2729  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

2716 var { headerNameLowerCasedRecord } = require_constants();
2717 var invalidPathRegex = /[^\u0021-\u00ff]/;
2718 function isValidContentLengthHeaderValue(val) {
2719 if (typeof val !== "string" || val.length === 0) {
2720 return false;
2721 }
2722 for (let i = 0; i < val.length; i++) {
2723 const charCode = val.charCodeAt(i);
2724 if (charCode < 48 || charCode > 57) {
2725 return false;
2726 }
2727 }
2728 return true;
2729 }
2730 __name(isValidContentLengthHeaderValue, "isValidContentLengthHeaderValue");
2731 var kHandler = /* @__PURE__ */ Symbol("handler");
2732 var kController = /* @__PURE__ */ Symbol("controller");

Callers 1

processHeaderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected