@ekhein/http-request 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/http-request.js +8 -8
- package/package.json +1 -1
package/dist/http-request.js
CHANGED
|
@@ -59,6 +59,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
59
59
|
const tldts_1 = __importDefault(require("tldts"));
|
|
60
60
|
const cookie = __importStar(require("cookie"));
|
|
61
61
|
const jsdom_1 = require("jsdom");
|
|
62
|
+
const lodash_1 = require("lodash");
|
|
62
63
|
const path_to_regexp_1 = require("path-to-regexp");
|
|
63
64
|
const tough_cookie_1 = require("tough-cookie");
|
|
64
65
|
const common_1 = require("@nestjs/common");
|
|
@@ -131,14 +132,13 @@ class HttpRequest {
|
|
|
131
132
|
/* Headers */
|
|
132
133
|
this.instance.interceptors.request.use((request) => __awaiter(this, void 0, void 0, function* () {
|
|
133
134
|
if (request.headers) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
135
|
+
Object
|
|
136
|
+
.entries(request.headers)
|
|
137
|
+
.forEach(([key, value]) => {
|
|
138
|
+
const name = (0, lodash_1.kebabCase)(key);
|
|
139
|
+
request.headers.delete(key);
|
|
140
|
+
request.headers.set(name, value);
|
|
141
|
+
});
|
|
142
142
|
}
|
|
143
143
|
return request;
|
|
144
144
|
}));
|