Skip to content

Commit

Permalink
fix(buffer): use node:buffer instead of safe-buffer (#6071)
Browse files Browse the repository at this point in the history
Main Changes:
- Removed dependency `safe-buffer@5.2.1`
- Use `node:buffer` core library instead of safe-buffer
  • Loading branch information
bhavya3024 authored Oct 27, 2024
1 parent 8cb53ea commit c70197a
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @private
*/

var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var contentDisposition = require('content-disposition');
var createError = require('http-errors')
var encodeUrl = require('encodeurl');
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @api private
*/

var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var contentType = require('content-type');
var etag = require('etag');
var mime = require('mime-types')
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"qs": "6.13.0",
"range-parser": "~1.2.1",
"router": "^2.0.0",
"safe-buffer": "5.2.1",
"send": "^1.1.0",
"serve-static": "^2.1.0",
"statuses": "2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion test/express.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var express = require('..')
var request = require('supertest')

Expand Down
2 changes: 1 addition & 1 deletion test/express.raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var express = require('..')
var request = require('supertest')

Expand Down
2 changes: 1 addition & 1 deletion test/express.static.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

var assert = require('assert')
var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var express = require('..')
var path = require('path')
var request = require('supertest')
Expand Down
2 changes: 1 addition & 1 deletion test/express.text.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var express = require('..')
var request = require('supertest')

Expand Down
2 changes: 1 addition & 1 deletion test/express.urlencoded.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var express = require('..')
var request = require('supertest')

Expand Down
2 changes: 1 addition & 1 deletion test/res.attachment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var express = require('../')
, request = require('supertest');

Expand Down
2 changes: 1 addition & 1 deletion test/res.download.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var after = require('after');
var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var express = require('..');
var path = require('path')
var request = require('supertest');
Expand Down
2 changes: 1 addition & 1 deletion test/res.send.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

var assert = require('assert')
var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var express = require('..');
var methods = require('methods');
var request = require('supertest');
Expand Down
2 changes: 1 addition & 1 deletion test/res.sendFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var after = require('after');
var assert = require('assert')
var asyncHooks = tryRequire('async_hooks')
var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var express = require('../')
, request = require('supertest')
var onFinished = require('on-finished');
Expand Down
2 changes: 1 addition & 1 deletion test/support/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

var assert = require('assert');
var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer

/**
* Module exports.
Expand Down
2 changes: 1 addition & 1 deletion test/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

var assert = require('assert');
var Buffer = require('safe-buffer').Buffer
var Buffer = require('node:buffer').Buffer
var utils = require('../lib/utils');

describe('utils.etag(body, encoding)', function(){
Expand Down

0 comments on commit c70197a

Please sign in to comment.