mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #4522 from gorenje/remove_unused_code
21-httprequest.js remove unused code, because of broken use of toLowercase
This commit is contained in:
commit
de5111b13f
@ -141,15 +141,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @param {Object} headersObject
|
|
||||||
* @param {string} name
|
|
||||||
* @return {any} value
|
|
||||||
*/
|
|
||||||
const getHeaderValue = (headersObject, name) => {
|
|
||||||
const asLowercase = name.toLowercase();
|
|
||||||
return headersObject[Object.keys(headersObject).find(k => k.toLowerCase() === asLowercase)];
|
|
||||||
}
|
|
||||||
this.on("input",function(msg,nodeSend,nodeDone) {
|
this.on("input",function(msg,nodeSend,nodeDone) {
|
||||||
checkNodeAgentPatch();
|
checkNodeAgentPatch();
|
||||||
//reset redirectList on each request
|
//reset redirectList on each request
|
||||||
@ -300,7 +292,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
|||||||
}
|
}
|
||||||
|
|
||||||
opts.headers = {};
|
opts.headers = {};
|
||||||
//add msg.headers
|
//add msg.headers
|
||||||
//NOTE: ui headers will take precidence over msg.headers
|
//NOTE: ui headers will take precidence over msg.headers
|
||||||
if (msg.headers) {
|
if (msg.headers) {
|
||||||
if (msg.headers.hasOwnProperty('x-node-red-request-node')) {
|
if (msg.headers.hasOwnProperty('x-node-red-request-node')) {
|
||||||
@ -633,7 +625,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
|||||||
msg.payload = msg.payload.toString('utf8'); // txt
|
msg.payload = msg.payload.toString('utf8'); // txt
|
||||||
|
|
||||||
if (node.ret === "obj") {
|
if (node.ret === "obj") {
|
||||||
if (msg.statusCode == 204){msg.payload= "{}"};
|
if (msg.statusCode == 204){msg.payload= "{}"};
|
||||||
try { msg.payload = JSON.parse(msg.payload); } // obj
|
try { msg.payload = JSON.parse(msg.payload); } // obj
|
||||||
catch(e) { node.warn(RED._("httpin.errors.json-error")); }
|
catch(e) { node.warn(RED._("httpin.errors.json-error")); }
|
||||||
}
|
}
|
||||||
@ -740,7 +732,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
|||||||
*
|
*
|
||||||
* If the algorithm directive's value ends with "-sess", then HA1 is
|
* If the algorithm directive's value ends with "-sess", then HA1 is
|
||||||
* HA1=digestCompute(digestCompute(username:realm:password):nonce:cnonce)
|
* HA1=digestCompute(digestCompute(username:realm:password):nonce:cnonce)
|
||||||
*
|
*
|
||||||
* If the algorithm directive's value does not end with "-sess", then HA1 is
|
* If the algorithm directive's value does not end with "-sess", then HA1 is
|
||||||
* HA1=digestCompute(username:realm:password)
|
* HA1=digestCompute(username:realm:password)
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user