We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1d18ed commit 71be407Copy full SHA for 71be407
lib/request.js
@@ -122,7 +122,12 @@ Request.prototype._createReqRes = function () {
122
123
for (var param in this.params) {
124
if (HEADER_EXPR.test(param) || param === 'CONTENT_LENGTH' || param === 'CONTENT_TYPE') {
125
- var name = param.slice(5).replace(UNDERSCORE_EXPR, '-');
+ var name = param.replace(HEADER_EXPR, '').replace(UNDERSCORE_EXPR, '-');
126
+
127
+ // Ignore HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH
128
+ if (HEADER_EXPR.test(param) && (name.toLowerCase() === 'content-type' || name.toLowerCase() === 'content-length'))
129
+ continue;
130
131
var value = this.params[param];
132
raw.push(name, value);
133
this._req._addHeaderLine(name, value, dest);
0 commit comments