Skip to content

Commit

Permalink
Use safe-buffer for improved Buffer API
Browse files Browse the repository at this point in the history
closes #21
  • Loading branch information
ChALkeR authored and dougwilson committed Mar 22, 2018
1 parent 1220d87 commit 8eaecc5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
unreleased
==========

* Use `safe-buffer` for improved Buffer API

0.5.2 / 2016-12-08
==================

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function decodefield (str) {
value = getlatin1(binary)
break
case 'utf-8':
value = new Buffer(binary, 'binary').toString('utf8')
value = Buffer.from(binary, 'binary').toString('utf8')

This comment has been minimized.

Copy link
@ChALkeR

ChALkeR Mar 22, 2018

Author Contributor

This breaks on e.g. 4.4.0.

break
default:
throw new TypeError('unsupported charset in extended field')
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"res"
],
"repository": "jshttp/content-disposition",
"dependencies": {
"safe-buffer": "5.1.1"
},
"devDependencies": {
"eslint": "3.19.0",
"eslint-config-standard": "7.0.0",
Expand Down

0 comments on commit 8eaecc5

Please sign in to comment.