From 35bd1c2b375ea70dc2b4a4549461ff59ff5e4ec4 Mon Sep 17 00:00:00 2001 From: Natalie Wolfe Date: Thu, 8 Feb 2018 16:17:46 -0800 Subject: [PATCH] fix: use `Buffer.isBuffer` instead of `util.isBuffer`. (#1593) --- lib/response.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/response.js b/lib/response.js index 9733cf89a..672e0ea93 100644 --- a/lib/response.js +++ b/lib/response.js @@ -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'); @@ -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'; }