Skip to content

Commit

Permalink
Merge 6d0f607 into b19219c
Browse files Browse the repository at this point in the history
  • Loading branch information
d00rman committed Aug 26, 2019
2 parents b19219c + 6d0f607 commit d841ce3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package-lock.json
coverage
.nyc_output
/node_modules
Expand Down
4 changes: 2 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ function handleResponse(opts, req, resp, response) {
// Convert to a buffer
if (typeof body === 'object') {
rh['content-type'] = rh['content-type'] || 'application/json';
body = new Buffer(JSON.stringify(body));
body = Buffer.from(JSON.stringify(body));
} else {
body = new Buffer(body);
body = Buffer.from(body);
}
}

Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hyperswitch",
"version": "0.12.6",
"version": "0.12.7",
"description": "REST API creation framework",
"main": "index.js",
"scripts": {
Expand All @@ -25,16 +25,16 @@
},
"homepage": "https://github.com/wikimedia/hyperswitch",
"dependencies": {
"ajv": "^6.5.4",
"bluebird": "^3.5.2",
"busboy": "^0.2.14",
"ajv": "^6.10.2",
"bluebird": "^3.5.5",
"busboy": "^0.3.1",
"fast-json-stable-stringify": "^2.0.0",
"js-yaml": "^3.12.0",
"preq": "^0.5.8",
"js-yaml": "^3.13.1",
"preq": "^0.5.11",
"regexp-utils": "^0.3.2",
"swagger-router": "^0.7.3",
"swagger-ui-dist": "^3.22.0",
"uuid": "^3.3.2"
"swagger-router": "^0.7.4",
"swagger-ui-dist": "^3.23.6",
"uuid": "^3.3.3"
},
"devDependencies": {
"coveralls": "^3.0.2",
Expand Down
6 changes: 4 additions & 2 deletions test/hyperswitch/hyperswitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('HyperSwitch context',() => {
.then(function (res) {
assert.deepEqual(res.status, 200);
assert.deepEqual(res.headers.test, 'test');
assert.deepEqual(res.body, new Buffer(''));
assert.deepEqual(res.body, Buffer.from(''));
});
});

Expand Down Expand Up @@ -75,7 +75,9 @@ describe('HyperSwitch context',() => {
type: 'https://mediawiki.org/wiki/HyperSwitch/errors/not_found#route',
title: 'Not found.',
method: 'get',
uri: '/this_path_does_not_exist/'
uri: '/this_path_does_not_exist/',
internalURI: 'http://localhost:12345/this_path_does_not_exist/',
internalMethod: 'get'
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/streaming/stream_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ function hello(hyper, req) {

function buffer(hyper, req) {
var body = new stream.PassThrough();
body.write(new Buffer('hel'));
body.write(Buffer.from('hel'));
// Delay the final write to test async production.
setTimeout(() => {
body.end(new Buffer('lo'));
body.end(Buffer.from('lo'));
}, 500);

return {
Expand Down

0 comments on commit d841ce3

Please sign in to comment.