Skip to content

Commit 9adb40d

Browse files
committed
Add proper middleware to httpAdmin route handler
1 parent e8a9936 commit 9adb40d

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#### 0.2.5
2+
3+
- Add proper middleware on httpAdmin express app
4+
15
#### 0.2.4
26

37
- Update dependencies

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const should = require('should');
2121
const fs = require('fs');
2222
require('should-sinon');
2323
const request = require('supertest');
24+
var bodyParser = require("body-parser");
2425
const express = require("express");
2526
const http = require('http');
2627
const stoppable = require('stoppable');
@@ -201,6 +202,9 @@ class NodeTestHelper extends EventEmitter {
201202

202203
const redNodes = this._redNodes;
203204
this._httpAdmin = express();
205+
this._httpAdmin.use(bodyParser.json({limit:'5mb'}));
206+
this._httpAdmin.use(bodyParser.urlencoded({limit:'5mb',extended:true}));
207+
204208
const mockRuntime = {
205209
nodes: redNodes,
206210
events: this._events,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-node-test-helper",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "A test framework for Node-RED nodes",
55
"main": "index.js",
66
"scripts": {
@@ -14,6 +14,7 @@
1414
},
1515
"dependencies": {
1616
"express": "4.17.1",
17+
"body-parser": "1.19.0",
1718
"read-pkg-up": "7.0.1",
1819
"semver": "7.3.2",
1920
"should": "^13.2.3",

0 commit comments

Comments
 (0)