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

Ensure apiMaxLength applies to HTTP Nodes

Fixes #1278
This commit is contained in:
Nick O'Leary 2018-05-30 13:32:38 +01:00
parent 4cfbf7f71c
commit 0a0ca380d3
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -21,8 +21,6 @@ module.exports = function(RED) {
var cookieParser = require("cookie-parser");
var getBody = require('raw-body');
var cors = require('cors');
var jsonParser = bodyParser.json();
var urlencParser = bodyParser.urlencoded({extended:true});
var onHeaders = require('on-headers');
var typer = require('media-typer');
var isUtf8 = require('is-utf8');
@ -212,6 +210,10 @@ module.exports = function(RED) {
}
}
var maxApiRequestSize = RED.settings.apiMaxLength || '5mb';
var jsonParser = bodyParser.json({limit:maxApiRequestSize});
var urlencParser = bodyParser.urlencoded({limit:maxApiRequestSize,extended:true});
var metricsHandler = function(req,res,next) { next(); }
if (this.metric()) {
metricsHandler = function(req, res, next) {