mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch 'master' into dev
This commit is contained in:
@@ -23,9 +23,9 @@
|
||||
"clone": "2.1.2",
|
||||
"cors": "2.8.5",
|
||||
"express-session": "1.16.1",
|
||||
"express": "4.17.0",
|
||||
"express": "4.17.1",
|
||||
"memorystore": "1.6.1",
|
||||
"mime": "2.4.3",
|
||||
"mime": "2.4.4",
|
||||
"mustache": "3.0.1",
|
||||
"oauth2orize": "1.11.0",
|
||||
"passport-http-bearer": "1.0.1",
|
||||
|
@@ -23,6 +23,7 @@ module.exports = function(RED) {
|
||||
var cors = require('cors');
|
||||
var onHeaders = require('on-headers');
|
||||
var typer = require('content-type');
|
||||
var mediaTyper = require('media-typer');
|
||||
var isUtf8 = require('is-utf8');
|
||||
var hashSum = require("hash-sum");
|
||||
|
||||
@@ -36,18 +37,22 @@ module.exports = function(RED) {
|
||||
var checkUTF = false;
|
||||
|
||||
if (req.headers['content-type']) {
|
||||
var parsedType = typer.parse(req.headers['content-type'])
|
||||
if (parsedType.type === "text") {
|
||||
isText = true;
|
||||
} else if (parsedType.subtype === "xml" || parsedType.suffix === "xml") {
|
||||
isText = true;
|
||||
} else if (parsedType.type !== "application") {
|
||||
isText = false;
|
||||
} else if (parsedType.subtype !== "octet-stream") {
|
||||
checkUTF = true;
|
||||
} else {
|
||||
// applicatino/octet-stream
|
||||
isText = false;
|
||||
var contentType = typer.parse(req.headers['content-type'])
|
||||
if (contentType.type) {
|
||||
var parsedType = mediaTyper.parse(contentType.type);
|
||||
if (parsedType.type === "text") {
|
||||
isText = true;
|
||||
} else if (parsedType.subtype === "xml" || parsedType.suffix === "xml") {
|
||||
isText = true;
|
||||
} else if (parsedType.type !== "application") {
|
||||
isText = false;
|
||||
} else if (parsedType.subtype !== "octet-stream") {
|
||||
checkUTF = true;
|
||||
} else {
|
||||
// applicatino/octet-stream
|
||||
isText = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -49,12 +49,13 @@
|
||||
<label for="node-input-useAuth" style="width: 70%;"><span data-i18n="httpin.basicauth"></span></label>
|
||||
<div style="margin-left: 20px" class="node-input-useAuth-row hide">
|
||||
<div class="form-row">
|
||||
<label for="node-input-authType"><i class="fa fa-user-secret "></i> <span data-i18n="httpin.label.authType"></span></label>
|
||||
<select type="text" id="node-input-authType" style="width:70%;">
|
||||
<label for="node-input-authType-select"><i class="fa fa-user-secret "></i> <span data-i18n="httpin.label.authType"></span></label>
|
||||
<select type="text" id="node-input-authType-select" style="width:70%;">
|
||||
<option value="basic" data-i18n="httpin.basic"></option>
|
||||
<option value="digest" data-i18n="httpin.digest"></option>
|
||||
<option value="bearer" data-i18n="httpin.bearer"></option>
|
||||
</select>
|
||||
<input type="hidden" id="node-input-authType">
|
||||
</div>
|
||||
<div class="form-row node-input-basic-row">
|
||||
<label for="node-input-user"><i class="fa fa-user"></i> <span data-i18n="common.label.username"></span></label>
|
||||
@@ -102,7 +103,7 @@
|
||||
url:{value:"",validate:function(v) { return (v.trim().length === 0) || (v.indexOf("://") === -1) || (v.trim().indexOf("http") === 0)} },
|
||||
tls: {type:"tls-config",required: false},
|
||||
proxy: {type:"http proxy",required: false},
|
||||
authType: {value: "basic"}
|
||||
authType: {value: ""}
|
||||
},
|
||||
credentials: {
|
||||
user: {type:"text"},
|
||||
@@ -130,7 +131,7 @@
|
||||
$(".node-input-useAuth-row").show();
|
||||
// Nodes (< version 0.20.x) with credentials but without authentication type, need type 'basic'
|
||||
if (!$('#node-input-authType').val()) {
|
||||
$('#node-input-authType').val('basic');
|
||||
$("#node-input-authType-select").val('basic').trigger("change");
|
||||
}
|
||||
} else {
|
||||
$(".node-input-useAuth-row").hide();
|
||||
@@ -139,12 +140,14 @@
|
||||
$('#node-input-password').val('');
|
||||
}
|
||||
});
|
||||
$("#node-input-authType").on("change", function() {
|
||||
if ($(this).val() == "basic" || $(this).val() == "digest") {
|
||||
$("#node-input-authType-select").on("change", function() {
|
||||
var val = $(this).val();
|
||||
$("#node-input-authType").val(val);
|
||||
if (val === "basic" || val === "digest") {
|
||||
$(".node-input-basic-row").show();
|
||||
$('#node-span-password').show();
|
||||
$('#node-span-token').hide();
|
||||
} else if ($(this).val() == "bearer") {
|
||||
} else if (val === "bearer") {
|
||||
$(".node-input-basic-row").hide();
|
||||
$('#node-span-password').hide();
|
||||
$('#node-span-token').show();
|
||||
@@ -158,8 +161,9 @@
|
||||
$(".node-input-paytoqs-row").hide();
|
||||
}
|
||||
});
|
||||
if (this.credentials.user || this.credentials.has_password) {
|
||||
if (this.authType) {
|
||||
$('#node-input-useAuth').prop('checked', true);
|
||||
$("#node-input-authType-select").val(this.authType);
|
||||
} else {
|
||||
$('#node-input-useAuth').prop('checked', false);
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@
|
||||
"https-proxy-agent": "2.2.1",
|
||||
"is-utf8": "0.2.1",
|
||||
"js-yaml": "3.13.1",
|
||||
"media-typer": "1.1.0",
|
||||
"mqtt": "2.18.8",
|
||||
"multer": "1.4.1",
|
||||
"mustache": "3.0.1",
|
||||
|
@@ -17,8 +17,8 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-red/util": "1.0.0-beta.2",
|
||||
"semver": "6.0.0",
|
||||
"uglify-js": "3.5.15",
|
||||
"semver": "6.1.1",
|
||||
"uglify-js": "3.6.0",
|
||||
"when": "3.7.8"
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@
|
||||
"@node-red/registry": "1.0.0-beta.2",
|
||||
"@node-red/util": "1.0.0-beta.2",
|
||||
"clone": "2.1.2",
|
||||
"express": "4.17.0",
|
||||
"express": "4.17.1",
|
||||
"fs-extra": "8.0.1",
|
||||
"json-stringify-safe": "5.0.1",
|
||||
"when": "3.7.8"
|
||||
|
4
packages/node_modules/node-red/package.json
vendored
4
packages/node_modules/node-red/package.json
vendored
@@ -37,7 +37,7 @@
|
||||
"@node-red/nodes": "1.0.0-beta.2",
|
||||
"basic-auth": "2.0.1",
|
||||
"bcryptjs": "2.4.3",
|
||||
"express": "4.17.0",
|
||||
"express": "4.17.1",
|
||||
"fs-extra": "8.0.1",
|
||||
"node-red-node-email": "^1.4.0",
|
||||
"node-red-node-feedparser": "^0.1.14",
|
||||
@@ -46,7 +46,7 @@
|
||||
"node-red-node-tail": "^0.0.2",
|
||||
"node-red-node-twitter": "^1.1.4",
|
||||
"nopt": "4.0.1",
|
||||
"semver": "6.0.0"
|
||||
"semver": "6.1.1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"bcrypt": "3.0.5"
|
||||
|
Reference in New Issue
Block a user