Skip to content

Commit

Permalink
fix(middleware): avoid using deprecated Buffer API
Browse files Browse the repository at this point in the history
safe-buffer is already used and provides Buffer.alloc polyfill, so
just use Buffer.alloc directly to avoid hitting deprecated API.

Refs:
https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor
  • Loading branch information
ChALkeR committed Mar 2, 2018
1 parent ac4e1a9 commit 018e6be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/middleware/common.js
Expand Up @@ -58,7 +58,7 @@ var createServeFile = function (fs, directory, config) {
return 206
} else {
// Multiple ranges are not supported. Maybe future?
responseData = new Buffer(0)
responseData = Buffer.alloc(0)
return 416
}
}
Expand Down

0 comments on commit 018e6be

Please sign in to comment.