From 6c648e4bab5bfc72892445363be912e63a090d5e Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Sat, 16 Jul 2022 19:51:35 +0100 Subject: [PATCH 1/2] Allow HTTP Headers not in spec potential fix for #3772 --- .../@node-red/nodes/core/network/21-httprequest.html | 12 ++++++++++++ .../@node-red/nodes/core/network/21-httprequest.js | 4 ++++ .../@node-red/nodes/locales/en-US/messages.json | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/nodes/core/network/21-httprequest.html b/packages/node_modules/@node-red/nodes/core/network/21-httprequest.html index bf1f76b7f..8b71e454e 100644 --- a/packages/node_modules/@node-red/nodes/core/network/21-httprequest.html +++ b/packages/node_modules/@node-red/nodes/core/network/21-httprequest.html @@ -91,6 +91,11 @@ +
+ + +
+
@@ -120,6 +125,7 @@ tls: {type:"tls-config",required: false}, persist: {value:false}, proxy: {type:"http proxy",required: false}, + insecureHTTPParser: {value: false}, authType: {value: ""}, senderr: {value: false} }, @@ -224,6 +230,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(); diff --git a/packages/node_modules/@node-red/nodes/core/network/21-httprequest.js b/packages/node_modules/@node-red/nodes/core/network/21-httprequest.js index bf677b490..4a426d4ec 100644 --- a/packages/node_modules/@node-red/nodes/core/network/21-httprequest.js +++ b/packages/node_modules/@node-red/nodes/core/network/21-httprequest.js @@ -214,6 +214,10 @@ in your Node-RED user directory (${RED.settings.userDir}). delete options.headers[h]; } }) + + if (node.insecureHTTPParser) { + options.insecureHTTPParser = true + } } ], beforeRedirect: [ diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json index ecc5d905c..e8edb0754 100755 --- a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json @@ -525,7 +525,8 @@ }, "status": { "requesting": "requesting" - } + }, + "insecureHTTPParser": "Lenient HTTP Header Parsing" }, "websocket": { "label": { From ce09f56dcc6fab34279c3b8b7cff954751b8e402 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 4 Aug 2022 13:10:05 +0100 Subject: [PATCH 2/2] Update packages/node_modules/@node-red/nodes/locales/en-US/messages.json --- .../node_modules/@node-red/nodes/locales/en-US/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json index e8edb0754..8dcddf763 100755 --- a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json @@ -526,7 +526,7 @@ "status": { "requesting": "requesting" }, - "insecureHTTPParser": "Lenient HTTP Header Parsing" + "insecureHTTPParser": "Disable strict HTTP parsing" }, "websocket": { "label": {