Skip to content

Commit

Permalink
fix: use Buffer.isBuffer instead of util.isBuffer. (#1593)
Browse files Browse the repository at this point in the history
  • Loading branch information
NatalieWolfe authored and William Blankenship committed Feb 9, 2018
1 parent bde8fda commit 35bd1c2
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 35bd1c2

Please sign in to comment.