Skip to content

Commit

Permalink
Merge pull request #3776 from hardillb/relaxed-http-req-headers
Browse files Browse the repository at this point in the history
Allow HTTP Headers not in spec
  • Loading branch information
knolleary committed Aug 4, 2022
2 parents be343cb + abccdc7 commit 371d804
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@
<label for="node-input-senderr" style="width: auto" data-i18n="httpin.senderr"></label>
</div>

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


<div class="form-row">
<label for="node-input-ret"><i class="fa fa-arrow-left"></i> <span data-i18n="httpin.label.return"></span></label>
Expand Down Expand Up @@ -227,6 +232,7 @@
persist: {value:false},
proxy: {type:"http proxy",required: false,
label:RED._("node-red:httpin.proxy-config") },
insecureHTTPParser: {value: false},
authType: {value: ""},
senderr: {value: false},
headers: { value: [] }
Expand Down Expand Up @@ -338,6 +344,12 @@
} else {
$("#node-input-useProxy").prop("checked", false);
}

if (node.insecureHTTPParser) {
$("node-intput-insecureHTTPParser").prop("checked", true)
} else {
$("node-intput-insecureHTTPParser").prop("checked", false)
}
updateProxyOptions();
$("#node-input-useProxy").on("click", function() {
updateProxyOptions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ in your Node-RED user directory (${RED.settings.userDir}).
delete options.headers[h];
}
})

if (node.insecureHTTPParser) {
options.insecureHTTPParser = true
}
}
],
beforeRedirect: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@
},
"status": {
"requesting": "requesting"
}
},
"insecureHTTPParser": "Disable strict HTTP parsing"
},
"websocket": {
"label": {
Expand Down

0 comments on commit 371d804

Please sign in to comment.