mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge 3a29330021d3f11cb3df403168783deff3c179af into bb01f26f068b8e083e35fdf19dc9b36f8cf67068
This commit is contained in:
commit
13c3711c80
@ -25,11 +25,22 @@
|
|||||||
<option value="patch">PATCH</option>
|
<option value="patch">PATCH</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row form-row-http-in-upload hide">
|
|
||||||
|
<div id="form-reqBody-http-in-controller" class="form-row hide" style="display: flex;">
|
||||||
<label> </label>
|
<label> </label>
|
||||||
<input type="checkbox" id="node-input-upload" style="display: inline-block; width: auto; vertical-align: top;">
|
<div style="display: flex; margin-left: 5px; flex-direction: column-reverse; gap:35%;">
|
||||||
<label for="node-input-upload" style="width: 70%;" data-i18n="httpin.label.upload"></label>
|
<div id="form-row-http-in-upload" class="hide" style="display: flex;">
|
||||||
|
<input type="checkbox" id="node-input-upload" style="margin-right: 5%; margin-bottom: 5%;">
|
||||||
|
<label for="node-input-upload" style="text-wrap: nowrap;" data-i18n="httpin.label.upload"></label>
|
||||||
|
</div>
|
||||||
|
<div id="form-row-http-in-rawdata" class="hide" style="display: flex;">
|
||||||
|
<input type="checkbox" id="node-input-includeRawBody" style="margin-right: 5%; margin-bottom: 5%;">
|
||||||
|
<label for="node-input-includeRawBody" style="text-wrap: nowrap;" data-i18n="httpin.label.rawBody"></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-url"><i class="fa fa-globe"></i> <span data-i18n="httpin.label.url"></span></label>
|
<label for="node-input-url"><i class="fa fa-globe"></i> <span data-i18n="httpin.label.url"></span></label>
|
||||||
<input id="node-input-url" type="text" placeholder="/url">
|
<input id="node-input-url" type="text" placeholder="/url">
|
||||||
@ -74,6 +85,7 @@
|
|||||||
label:RED._("node-red:httpin.label.url")},
|
label:RED._("node-red:httpin.label.url")},
|
||||||
method: {value:"get",required:true},
|
method: {value:"get",required:true},
|
||||||
upload: {value:false},
|
upload: {value:false},
|
||||||
|
includeRawBody: {value:false},
|
||||||
swaggerDoc: {type:"swagger-doc", required:false}
|
swaggerDoc: {type:"swagger-doc", required:false}
|
||||||
},
|
},
|
||||||
inputs:0,
|
inputs:0,
|
||||||
@ -115,16 +127,22 @@
|
|||||||
$('.row-swagger-doc').hide();
|
$('.row-swagger-doc').hide();
|
||||||
}
|
}
|
||||||
$("#node-input-method").on("change", function() {
|
$("#node-input-method").on("change", function() {
|
||||||
if ($(this).val() === "post") {
|
var method = $(this).val();
|
||||||
$(".form-row-http-in-upload").show();
|
if(["post", "put", "patch","delete"].includes(method)){
|
||||||
|
$("#form-reqBody-http-in-controller").show();
|
||||||
|
$("#form-row-http-in-rawdata").show();
|
||||||
|
if (method === "post") {
|
||||||
|
$("#form-row-http-in-upload").show();
|
||||||
|
} else {
|
||||||
|
$("#form-row-http-in-upload").hide();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$(".form-row-http-in-upload").hide();
|
$("#form-row-http-in-rawdata").hide();
|
||||||
|
$("#form-row-http-in-upload").hide();
|
||||||
|
$("#form-reqBody-http-in-controller").hide();
|
||||||
}
|
}
|
||||||
}).change();
|
}).change();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
var headerTypes = [
|
var headerTypes = [
|
||||||
{value:"content-type",label:"Content-Type",hasValue: false},
|
{value:"content-type",label:"Content-Type",hasValue: false},
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
module.exports = function(RED) {
|
module.exports = function(RED) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
var rootApp;
|
||||||
var bodyParser = require("body-parser");
|
var bodyParser = require("body-parser");
|
||||||
var multer = require("multer");
|
var multer = require("multer");
|
||||||
var cookieParser = require("cookie-parser");
|
var cookieParser = require("cookie-parser");
|
||||||
@ -26,16 +27,21 @@ module.exports = function(RED) {
|
|||||||
var mediaTyper = require('media-typer');
|
var mediaTyper = require('media-typer');
|
||||||
var isUtf8 = require('is-utf8');
|
var isUtf8 = require('is-utf8');
|
||||||
var hashSum = require("hash-sum");
|
var hashSum = require("hash-sum");
|
||||||
|
var PassThrough = require('stream').PassThrough;
|
||||||
|
var rawDataRoutes = new Set();
|
||||||
|
|
||||||
function rawBodyParser(req, res, next) {
|
/**
|
||||||
if (req.skipRawBodyParser) { next(); } // don't parse this if told to skip
|
* This middleware parses the raw body if the user enables it.
|
||||||
if (req._body) { return next(); }
|
* @param {import('express').Request} req
|
||||||
req.body = "";
|
* @param {import('express').Response} _res
|
||||||
req._body = true;
|
* @param {import('express').NextFunction} next
|
||||||
|
* @returns
|
||||||
var isText = true;
|
*/
|
||||||
var checkUTF = false;
|
function rawBodyParser(req, _res, next) {
|
||||||
|
if (!req._nodeRedReqStream) {
|
||||||
|
return next();
|
||||||
|
}
|
||||||
|
var isText = true, checkUTF = false;
|
||||||
if (req.headers['content-type']) {
|
if (req.headers['content-type']) {
|
||||||
var contentType = typer.parse(req.headers['content-type'])
|
var contentType = typer.parse(req.headers['content-type'])
|
||||||
if (contentType.type) {
|
if (contentType.type) {
|
||||||
@ -51,27 +57,115 @@ module.exports = function(RED) {
|
|||||||
&& (parsedType.subtype !== "x-protobuf")) {
|
&& (parsedType.subtype !== "x-protobuf")) {
|
||||||
checkUTF = true;
|
checkUTF = true;
|
||||||
} else {
|
} else {
|
||||||
// application/octet-stream or application/cbor
|
|
||||||
isText = false;
|
isText = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getBody(req, {
|
getBody(req._nodeRedReqStream, {
|
||||||
length: req.headers['content-length'],
|
length: req.headers['content-length'],
|
||||||
encoding: isText ? "utf8" : null
|
encoding: isText ? "utf8" : null
|
||||||
}, function (err, buf) {
|
}, function (err, buf) {
|
||||||
if (err) { return next(err); }
|
if (err) {
|
||||||
|
return next(err);
|
||||||
|
}
|
||||||
if (!isText && checkUTF && isUtf8(buf)) {
|
if (!isText && checkUTF && isUtf8(buf)) {
|
||||||
buf = buf.toString()
|
buf = buf.toString()
|
||||||
}
|
}
|
||||||
req.body = buf;
|
Object.defineProperty(req, "rawRequestBody", {
|
||||||
next();
|
value: buf,
|
||||||
|
enumerable: true
|
||||||
|
});
|
||||||
|
return next();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var corsSetup = false;
|
/**
|
||||||
|
* This method retrieves the root app by traversing the parent hierarchy.
|
||||||
|
* @param {import('express').Application} app
|
||||||
|
* @returns {import('express').Application}
|
||||||
|
*/
|
||||||
|
function getRootApp(app) {
|
||||||
|
if (typeof app.parent === 'undefined') {
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
return getRootApp(app.parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It provide the unique route key
|
||||||
|
* @param {{method: string, url: string}} obj
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
function getRouteKey(obj) {
|
||||||
|
var method = obj.method.toUpperCase();
|
||||||
|
// Normalize the URL by replacing double slashes with a single slash and removing the trailing slash
|
||||||
|
var url = obj.url.replace(/\/{2,}/g, '/').replace(/\/$/, '');
|
||||||
|
return `${method}:${url}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This middleware is for clone the request stream
|
||||||
|
* @param {import('express').Request} req
|
||||||
|
* @param {import('express').Response} _res
|
||||||
|
* @param {import('express').NextFunction} next
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
function setupRawBodyCapture(req, _res, next) {
|
||||||
|
var routeKey = getRouteKey({ method: req.method, url: req._parsedUrl.pathname });
|
||||||
|
// Check if routeKey exist in rawDataRoutes
|
||||||
|
if (rawDataRoutes.has(routeKey)) {
|
||||||
|
|
||||||
|
// Create a PassThrough stream to capture the request body
|
||||||
|
var cloneStream = new PassThrough();
|
||||||
|
|
||||||
|
// Function to handle 'data' event
|
||||||
|
function onData(chunk) {
|
||||||
|
// Safely call clone stream write
|
||||||
|
if (cloneStream.writable) {
|
||||||
|
cloneStream.write(chunk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to handle 'end' or 'error' events
|
||||||
|
function onEnd(err) {
|
||||||
|
if (err) {
|
||||||
|
// Safely call clone stream destroy method
|
||||||
|
if (!cloneStream.destroyed) {
|
||||||
|
cloneStream.destroy(err);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Safely call clone stream end method
|
||||||
|
if (cloneStream.writable) {
|
||||||
|
cloneStream.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attach event listeners to the request stream
|
||||||
|
req.on('data', onData)
|
||||||
|
.once('end', onEnd)
|
||||||
|
.once('error', onEnd)
|
||||||
|
// Remove listeners once the request is closed
|
||||||
|
.once('close', () => {
|
||||||
|
req.removeListener('data', onData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Attach the clone stream to the request
|
||||||
|
Object.defineProperty(req, "_nodeRedReqStream", {
|
||||||
|
value: cloneStream
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Proceed to the next middleware
|
||||||
|
return next();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(typeof RED.httpNode === 'function' && (rootApp = getRootApp(RED.httpNode))) {
|
||||||
|
// Add middleware to the stack
|
||||||
|
rootApp.use(setupRawBodyCapture);
|
||||||
|
// Move the middleware to top of the stack
|
||||||
|
rootApp._router.stack.unshift(rootApp._router.stack.pop());
|
||||||
|
}
|
||||||
|
|
||||||
function createRequestWrapper(node,req) {
|
function createRequestWrapper(node,req) {
|
||||||
// This misses a bunch of properties (eg headers). Before we use this function
|
// This misses a bunch of properties (eg headers). Before we use this function
|
||||||
@ -125,6 +219,7 @@ module.exports = function(RED) {
|
|||||||
|
|
||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createResponseWrapper(node,res) {
|
function createResponseWrapper(node,res) {
|
||||||
var wrapper = {
|
var wrapper = {
|
||||||
_res: res
|
_res: res
|
||||||
@ -188,9 +283,16 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
this.method = n.method;
|
this.method = n.method;
|
||||||
this.upload = n.upload;
|
this.upload = n.upload;
|
||||||
|
this.includeRawBody = n.includeRawBody;
|
||||||
this.swaggerDoc = n.swaggerDoc;
|
this.swaggerDoc = n.swaggerDoc;
|
||||||
|
|
||||||
var node = this;
|
var node = this;
|
||||||
|
var routeKey = getRouteKey({method: this.method, url: RED.httpNode.path() + this.url});
|
||||||
|
|
||||||
|
// If the user enables raw body, add it to the raw data routes.
|
||||||
|
if(this.includeRawBody) {
|
||||||
|
rawDataRoutes.add(routeKey);
|
||||||
|
}
|
||||||
|
|
||||||
this.errorHandler = function(err,req,res,next) {
|
this.errorHandler = function(err,req,res,next) {
|
||||||
node.warn(err);
|
node.warn(err);
|
||||||
@ -227,7 +329,9 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var maxApiRequestSize = RED.settings.apiMaxLength || '5mb';
|
var maxApiRequestSize = RED.settings.apiMaxLength || '5mb';
|
||||||
|
|
||||||
var jsonParser = bodyParser.json({limit:maxApiRequestSize});
|
var jsonParser = bodyParser.json({limit:maxApiRequestSize});
|
||||||
|
|
||||||
var urlencParser = bodyParser.urlencoded({limit:maxApiRequestSize,extended:true});
|
var urlencParser = bodyParser.urlencoded({limit:maxApiRequestSize,extended:true});
|
||||||
|
|
||||||
var metricsHandler = function(req,res,next) { next(); }
|
var metricsHandler = function(req,res,next) { next(); }
|
||||||
@ -254,25 +358,27 @@ module.exports = function(RED) {
|
|||||||
var mp = multer({ storage: multer.memoryStorage() }).any();
|
var mp = multer({ storage: multer.memoryStorage() }).any();
|
||||||
multipartParser = function(req,res,next) {
|
multipartParser = function(req,res,next) {
|
||||||
mp(req,res,function(err) {
|
mp(req,res,function(err) {
|
||||||
req._body = true;
|
|
||||||
next(err);
|
next(err);
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.method == "get") {
|
if (this.method == "get") {
|
||||||
RED.httpNode.get(this.url,cookieParser(),httpMiddleware,corsHandler,metricsHandler,this.callback,this.errorHandler);
|
RED.httpNode.get(this.url, cookieParser(), httpMiddleware, corsHandler, metricsHandler, this.callback, this.errorHandler);
|
||||||
} else if (this.method == "post") {
|
} else if (this.method == "post") {
|
||||||
RED.httpNode.post(this.url,cookieParser(),httpMiddleware,corsHandler,metricsHandler,jsonParser,urlencParser,multipartParser,rawBodyParser,this.callback,this.errorHandler);
|
RED.httpNode.post(this.url,cookieParser(), httpMiddleware, corsHandler, metricsHandler, jsonParser, urlencParser, multipartParser, rawBodyParser, this.callback, this.errorHandler);
|
||||||
} else if (this.method == "put") {
|
} else if (this.method == "put") {
|
||||||
RED.httpNode.put(this.url,cookieParser(),httpMiddleware,corsHandler,metricsHandler,jsonParser,urlencParser,rawBodyParser,this.callback,this.errorHandler);
|
RED.httpNode.put(this.url, cookieParser(), httpMiddleware, corsHandler, metricsHandler, jsonParser, urlencParser, rawBodyParser, this.callback, this.errorHandler);
|
||||||
} else if (this.method == "patch") {
|
} else if (this.method == "patch") {
|
||||||
RED.httpNode.patch(this.url,cookieParser(),httpMiddleware,corsHandler,metricsHandler,jsonParser,urlencParser,rawBodyParser,this.callback,this.errorHandler);
|
RED.httpNode.patch(this.url, cookieParser(), httpMiddleware, corsHandler, metricsHandler, jsonParser, urlencParser, rawBodyParser, this.callback, this.errorHandler);
|
||||||
} else if (this.method == "delete") {
|
} else if (this.method == "delete") {
|
||||||
RED.httpNode.delete(this.url,cookieParser(),httpMiddleware,corsHandler,metricsHandler,jsonParser,urlencParser,rawBodyParser,this.callback,this.errorHandler);
|
RED.httpNode.delete(this.url, cookieParser(), httpMiddleware, corsHandler, metricsHandler, jsonParser, urlencParser, rawBodyParser, this.callback, this.errorHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.on("close",function() {
|
this.on("close",function() {
|
||||||
|
// Remove it from the raw data routes if the node is closed
|
||||||
|
rawDataRoutes.delete(routeKey);
|
||||||
var node = this;
|
var node = this;
|
||||||
RED.httpNode._router.stack.forEach(function(route,i,routes) {
|
RED.httpNode._router.stack.forEach(function(route,i,routes) {
|
||||||
if (route.route && route.route.path === node.url && route.route.methods[node.method]) {
|
if (route.route && route.route.path === node.url && route.route.methods[node.method]) {
|
||||||
@ -284,8 +390,8 @@ module.exports = function(RED) {
|
|||||||
this.warn(RED._("httpin.errors.not-created"));
|
this.warn(RED._("httpin.errors.not-created"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RED.nodes.registerType("http in",HTTPIn);
|
|
||||||
|
|
||||||
|
RED.nodes.registerType("http in",HTTPIn);
|
||||||
|
|
||||||
function HTTPOut(n) {
|
function HTTPOut(n) {
|
||||||
RED.nodes.createNode(this,n);
|
RED.nodes.createNode(this,n);
|
||||||
@ -361,5 +467,6 @@ module.exports = function(RED) {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
RED.nodes.registerType("http response",HTTPOut);
|
RED.nodes.registerType("http response",HTTPOut);
|
||||||
}
|
}
|
||||||
|
@ -451,6 +451,7 @@
|
|||||||
"upload": "Dateiuploads akzeptieren",
|
"upload": "Dateiuploads akzeptieren",
|
||||||
"status": "Statuscode",
|
"status": "Statuscode",
|
||||||
"headers": "Kopfzeilen",
|
"headers": "Kopfzeilen",
|
||||||
|
"rawBody": "Rohdaten einbeziehen?",
|
||||||
"other": "andere",
|
"other": "andere",
|
||||||
"paytoqs": {
|
"paytoqs": {
|
||||||
"ignore": "Ignorieren",
|
"ignore": "Ignorieren",
|
||||||
|
@ -515,6 +515,7 @@
|
|||||||
"doc": "Docs",
|
"doc": "Docs",
|
||||||
"return": "Return",
|
"return": "Return",
|
||||||
"upload": "Accept file uploads?",
|
"upload": "Accept file uploads?",
|
||||||
|
"rawBody": "Include Raw Data?",
|
||||||
"status": "Status code",
|
"status": "Status code",
|
||||||
"headers": "Headers",
|
"headers": "Headers",
|
||||||
"other": "other",
|
"other": "other",
|
||||||
|
@ -518,6 +518,7 @@
|
|||||||
"status": "Status code",
|
"status": "Status code",
|
||||||
"headers": "Headers",
|
"headers": "Headers",
|
||||||
"other": "otro",
|
"other": "otro",
|
||||||
|
"rawBody": "¿Incluir datos sin procesar?",
|
||||||
"paytoqs": {
|
"paytoqs": {
|
||||||
"ignore": "Ignore",
|
"ignore": "Ignore",
|
||||||
"query": "Append to query-string parameters",
|
"query": "Append to query-string parameters",
|
||||||
|
@ -518,6 +518,7 @@
|
|||||||
"status": "Code d'état",
|
"status": "Code d'état",
|
||||||
"headers": "En-têtes",
|
"headers": "En-têtes",
|
||||||
"other": "Autre",
|
"other": "Autre",
|
||||||
|
"rawBody": "Inclure les données brutes ?",
|
||||||
"paytoqs": {
|
"paytoqs": {
|
||||||
"ignore": "Ignorer",
|
"ignore": "Ignorer",
|
||||||
"query": "Joindre aux paramètres de chaîne de requête",
|
"query": "Joindre aux paramètres de chaîne de requête",
|
||||||
|
@ -518,6 +518,7 @@
|
|||||||
"status": "ステータスコード",
|
"status": "ステータスコード",
|
||||||
"headers": "ヘッダ",
|
"headers": "ヘッダ",
|
||||||
"other": "その他",
|
"other": "その他",
|
||||||
|
"rawBody": "生データを含める?",
|
||||||
"paytoqs": {
|
"paytoqs": {
|
||||||
"ignore": "無視",
|
"ignore": "無視",
|
||||||
"query": "クエリパラメータに追加",
|
"query": "クエリパラメータに追加",
|
||||||
|
@ -397,7 +397,8 @@
|
|||||||
"binaryBuffer": "바이너리 버퍼",
|
"binaryBuffer": "바이너리 버퍼",
|
||||||
"jsonObject": "JSON오브젝트",
|
"jsonObject": "JSON오브젝트",
|
||||||
"authType": "종류별",
|
"authType": "종류별",
|
||||||
"bearerToken": "토큰"
|
"bearerToken": "토큰",
|
||||||
|
"rawBody": "원시 데이터를 포함할까요?"
|
||||||
},
|
},
|
||||||
"setby": "- msg.method에 정의 -",
|
"setby": "- msg.method에 정의 -",
|
||||||
"basicauth": "인증을 사용",
|
"basicauth": "인증을 사용",
|
||||||
|
@ -506,6 +506,7 @@
|
|||||||
"status": "Código de estado",
|
"status": "Código de estado",
|
||||||
"headers": "Cabeçalhos",
|
"headers": "Cabeçalhos",
|
||||||
"other": "outro",
|
"other": "outro",
|
||||||
|
"rawBody": "Incluir dados brutos?",
|
||||||
"paytoqs" : {
|
"paytoqs" : {
|
||||||
"ignore": "Ignorar",
|
"ignore": "Ignorar",
|
||||||
"query": "Anexar aos parâmetros da cadeia de caracteres de consulta",
|
"query": "Anexar aos parâmetros da cadeia de caracteres de consulta",
|
||||||
|
@ -411,6 +411,7 @@
|
|||||||
"status": "Код состояния",
|
"status": "Код состояния",
|
||||||
"headers": "Заголовки",
|
"headers": "Заголовки",
|
||||||
"other": "другое",
|
"other": "другое",
|
||||||
|
"rawBody": "Включить необработанные данные?",
|
||||||
"paytoqs": {
|
"paytoqs": {
|
||||||
"ignore": "Игнорировать",
|
"ignore": "Игнорировать",
|
||||||
"query": "Добавлять к параметрам строки запроса",
|
"query": "Добавлять к параметрам строки запроса",
|
||||||
|
@ -508,6 +508,7 @@
|
|||||||
"status": "状态码",
|
"status": "状态码",
|
||||||
"headers": "头",
|
"headers": "头",
|
||||||
"other": "其他",
|
"other": "其他",
|
||||||
|
"rawBody": "包含原始数据?",
|
||||||
"paytoqs": {
|
"paytoqs": {
|
||||||
"ignore": "忽略",
|
"ignore": "忽略",
|
||||||
"query": "附加到查询字符串参数",
|
"query": "附加到查询字符串参数",
|
||||||
|
@ -416,7 +416,8 @@
|
|||||||
"binaryBuffer": "二進制buffer",
|
"binaryBuffer": "二進制buffer",
|
||||||
"jsonObject": "解析的JSON對象",
|
"jsonObject": "解析的JSON對象",
|
||||||
"authType": "類型",
|
"authType": "類型",
|
||||||
"bearerToken": "Token"
|
"bearerToken": "Token",
|
||||||
|
"rawBody": "包含原始數據?"
|
||||||
},
|
},
|
||||||
"setby": "- 用 msg.method 設定 -",
|
"setby": "- 用 msg.method 設定 -",
|
||||||
"basicauth": "基本認證",
|
"basicauth": "基本認證",
|
||||||
|
2
packages/node_modules/node-red/red.js
vendored
2
packages/node_modules/node-red/red.js
vendored
@ -65,6 +65,7 @@ var knownOpts = {
|
|||||||
"version": Boolean,
|
"version": Boolean,
|
||||||
"define": [String, Array]
|
"define": [String, Array]
|
||||||
};
|
};
|
||||||
|
|
||||||
var shortHands = {
|
var shortHands = {
|
||||||
"?":["--help"],
|
"?":["--help"],
|
||||||
"p":["--port"],
|
"p":["--port"],
|
||||||
@ -286,7 +287,6 @@ httpsPromise.then(function(startupHttps) {
|
|||||||
server = http.createServer(function(req,res) {app(req,res);});
|
server = http.createServer(function(req,res) {app(req,res);});
|
||||||
}
|
}
|
||||||
server.setMaxListeners(0);
|
server.setMaxListeners(0);
|
||||||
|
|
||||||
function formatRoot(root) {
|
function formatRoot(root) {
|
||||||
if (root[0] != "/") {
|
if (root[0] != "/") {
|
||||||
root = "/" + root;
|
root = "/" + root;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user