Skip to content

Commit

Permalink
Use Buffer.isBuffer instead of util.isBuffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
NatalieWolfe committed Jan 30, 2018
1 parent 74e0cf5 commit 62d2ad6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/response.js
Expand Up @@ -5,7 +5,6 @@
var http = require('http');
var sprintf = require('util').format;
var url = require('url');
var util = require('util');

var assert = require('assert-plus');
var mime = require('mime');
Expand Down Expand Up @@ -446,7 +445,7 @@ function patch(Response) {

// Set Content-Type to application/json when
// res.send is called with an Object instead of calling res.json
if (!type && typeof body === 'object' && !util.isBuffer(body)) {
if (!type && typeof body === 'object' && !Buffer.isBuffer(body)) {
type = 'application/json';
}

Expand Down

0 comments on commit 62d2ad6

Please sign in to comment.