1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge branch 'master' into dev

This commit is contained in:
Nick O'Leary 2019-06-21 14:01:34 +01:00
commit 677442a3c0
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
9 changed files with 53 additions and 32 deletions

View File

@ -46,8 +46,18 @@ Nodes
- Add expand editor button to Template node
- Update catch/status nodes to use selectNodes api and treeList
#### 0.20.6: Maintenance Release
- Revealing node position needs to account for zoom level Fixes #2172
- stop join tripping up if last message of buffer is blank.
- Improve handling of file upload in request node
- Handle subflow internal node wired to a non-existant node Fixes #2202
- Do not save subflow env vars with blank names
- Don't allow a link node virtual wire to connect to normal port
- Clear HTTP Request node authType when auth disabled Fixes #2215
- Fix parsing of content-type header Fixes #2216
- Fix join node reset issue with merging objects
- Copy data-i18n attribute on TypedInput Fixes #2211
#### 0.20.5: Maintenance Release

View File

@ -36,7 +36,7 @@
"cors": "2.8.5",
"cron": "1.7.1",
"denque": "1.4.1",
"express": "4.17.0",
"express": "4.17.1",
"express-session": "1.16.1",
"fs-extra": "8.0.1",
"fs.notify": "0.0.4",
@ -48,8 +48,9 @@
"js-yaml": "3.13.1",
"json-stringify-safe": "5.0.1",
"jsonata": "1.6.4",
"media-typer": "1.1.0",
"memorystore": "1.6.1",
"mime": "2.4.3",
"mime": "2.4.4",
"mqtt": "2.18.8",
"multer": "1.4.1",
"mustache": "3.0.1",
@ -67,8 +68,8 @@
"passport-oauth2-client-password": "0.1.2",
"raw-body": "2.4.0",
"request": "2.88.0",
"semver": "6.0.0",
"uglify-js": "3.5.15",
"semver": "6.1.1",
"uglify-js": "3.6.0",
"when": "3.7.8",
"ws": "6.2.1",
"xml2js": "0.4.19"

View File

@ -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",

View File

@ -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;
}
}
}

View File

@ -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);
}

View File

@ -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",

View File

@ -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"
}
}

View File

@ -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"

View File

@ -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"