MCPcopy
hub / github.com/di-sukharev/opencommit / createHeadersLenient

Function createHeadersLenient

out/cli.cjs:6677–6699  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

6675 return obj;
6676 }
6677 function createHeadersLenient(obj) {
6678 const headers = new Headers6();
6679 for (const name of Object.keys(obj)) {
6680 if (invalidTokenRegex.test(name)) {
6681 continue;
6682 }
6683 if (Array.isArray(obj[name])) {
6684 for (const val of obj[name]) {
6685 if (invalidHeaderCharRegex.test(val)) {
6686 continue;
6687 }
6688 if (headers[MAP][name] === void 0) {
6689 headers[MAP][name] = [val];
6690 } else {
6691 headers[MAP][name].push(val);
6692 }
6693 }
6694 } else if (!invalidHeaderCharRegex.test(obj[name])) {
6695 headers[MAP][name] = [obj[name]];
6696 }
6697 }
6698 return headers;
6699 }
6700 var INTERNALS$1 = Symbol("Response internals");
6701 var STATUS_CODES = http4.STATUS_CODES;
6702 var Response6 = class _Response {

Callers 1

fetch4Function · 0.85

Calls 3

testMethod · 0.80
keysMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…