Skip to content

Commit 5268cf6

Browse files
committed
fixes UserDecorator
1 parent 2d729fc commit 5268cf6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/userResDecorator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ describe('userResDecorator', function () {
7979
app.use(proxy('localhost:12345', {
8080
userResDecorator: function (proxyRes, proxyResData) {
8181
return new Promise(function (resolve) {
82-
var data = JSON.parse(proxyResData.toString('utf8'));
83-
data.funkyMessage = 'oi io oo ii';
82+
const decoratedResponse = JSON.parse(proxyResData.toString());
83+
decoratedResponse.funkyMessage = 'oi io oo ii';
8484
setTimeout(function () {
85-
resolve(JSON.stringify(data));
85+
resolve(JSON.stringify(decoratedResponse));
8686
}, 200);
8787
});
8888
}

0 commit comments

Comments
 (0)