Skip to content

Commit c849467

Browse files
committed
use Buffer global in http.js
Since the http adapter is never used in the browser it's safe to use the Buffer global and its isBuffer() method directly.
1 parent c82753c commit c849467

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/adapters/http.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ var httpsFollow = require('follow-redirects').https;
1010
var url = require('url');
1111
var zlib = require('zlib');
1212
var pkg = require('./../../package.json');
13-
var Buffer = require('buffer').Buffer;
1413
var createError = require('../core/createError');
1514
var enhanceError = require('../core/enhanceError');
1615

@@ -30,7 +29,7 @@ module.exports = function httpAdapter(config) {
3029
}
3130

3231
if (data && !utils.isStream(data)) {
33-
if (utils.isBuffer(data)) {
32+
if (Buffer.isBuffer(data)) {
3433
// Nothing to do...
3534
} else if (utils.isArrayBuffer(data)) {
3635
data = new Buffer(new Uint8Array(data));

0 commit comments

Comments
 (0)