UNPKG

628 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.prepareRequest = void 0;
4const cloneRequest_1 = require("./cloneRequest");
5const constants_1 = require("./constants");
6const prepareRequest = (request) => {
7 request = typeof request.clone === "function" ? request.clone() : (0, cloneRequest_1.cloneRequest)(request);
8 for (const headerName of Object.keys(request.headers)) {
9 if (constants_1.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {
10 delete request.headers[headerName];
11 }
12 }
13 return request;
14};
15exports.prepareRequest = prepareRequest;