UNPKG

next

Version:

The React Framework

23 lines (22 loc) 637 B
export const ipcForbiddenHeaders = [ "accept-encoding", "keepalive", "keep-alive", "content-encoding", "transfer-encoding", // https://github.com/nodejs/undici/issues/1470 "connection" ]; export const actionsForbiddenHeaders = [ ...ipcForbiddenHeaders, "content-length" ]; export const filterReqHeaders = (headers, forbiddenHeaders)=>{ for (const [key, value] of Object.entries(headers)){ if (forbiddenHeaders.includes(key) || !(Array.isArray(value) || typeof value === "string")) { delete headers[key]; } } return headers; }; //# sourceMappingURL=utils.js.map