Skip to content

Commit 371d804

Browse files
authored
Merge pull request #3776 from hardillb/relaxed-http-req-headers
Allow HTTP Headers not in spec
2 parents be343cb + abccdc7 commit 371d804

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

packages/node_modules/@node-red/nodes/core/network/21-httprequest.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@
9191
<label for="node-input-senderr" style="width: auto" data-i18n="httpin.senderr"></label>
9292
</div>
9393

94+
<div class="form-row">
95+
<input type="checkbox" id="node-input-insecureHTTPParser" style="display: inline-block; width: auto; vertical-align: top;">
96+
<label for="node-input-insecureHTTPParser", style="width: auto;" data-i18n="httpin.insecureHTTPParser"></label>
97+
</div>
98+
9499

95100
<div class="form-row">
96101
<label for="node-input-ret"><i class="fa fa-arrow-left"></i> <span data-i18n="httpin.label.return"></span></label>
@@ -227,6 +232,7 @@
227232
persist: {value:false},
228233
proxy: {type:"http proxy",required: false,
229234
label:RED._("node-red:httpin.proxy-config") },
235+
insecureHTTPParser: {value: false},
230236
authType: {value: ""},
231237
senderr: {value: false},
232238
headers: { value: [] }
@@ -338,6 +344,12 @@
338344
} else {
339345
$("#node-input-useProxy").prop("checked", false);
340346
}
347+
348+
if (node.insecureHTTPParser) {
349+
$("node-intput-insecureHTTPParser").prop("checked", true)
350+
} else {
351+
$("node-intput-insecureHTTPParser").prop("checked", false)
352+
}
341353
updateProxyOptions();
342354
$("#node-input-useProxy").on("click", function() {
343355
updateProxyOptions();

packages/node_modules/@node-red/nodes/core/network/21-httprequest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ in your Node-RED user directory (${RED.settings.userDir}).
244244
delete options.headers[h];
245245
}
246246
})
247+
248+
if (node.insecureHTTPParser) {
249+
options.insecureHTTPParser = true
250+
}
247251
}
248252
],
249253
beforeRedirect: [

packages/node_modules/@node-red/nodes/locales/en-US/messages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,8 @@
554554
},
555555
"status": {
556556
"requesting": "requesting"
557-
}
557+
},
558+
"insecureHTTPParser": "Disable strict HTTP parsing"
558559
},
559560
"websocket": {
560561
"label": {

0 commit comments

Comments
 (0)