Apply no-buffer-constructor lint rule
This commit is contained in:
1 parent
d85afcd2b5
commit
b43088c03c
6 files changed
+8
-7
No files matched your search
+1
-1
@@ -64,7 +64,7 @@ function listener(request, response) {
|
||||
|
||||
function getBody() {
|
||||
// Write all chunks into a Buffer
|
||||
const body = new Buffer(bytes);
|
||||
const body = Buffer.allocUnsafe(bytes);
|
||||
let offset = 0;
|
||||
for (const chunk of chunks) {
|
||||
chunk.copy(body, offset, 0, chunk.length);
|
||||
|
||||
Reference in new issue
Block a user