Skip to content

Commit 6e2ada9

Browse files
authored
Update file-type (#234)
1 parent a17166a commit 6e2ada9

File tree

3 files changed

+68
-19
lines changed

3 files changed

+68
-19
lines changed

lib/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default class HTTPClient {
122122

123123
const res = await this.instance.post(url, buffer, {
124124
headers: {
125-
"Content-Type": contentType || fileType(buffer).mime,
125+
"Content-Type": contentType || (await fileType.fromBuffer(buffer)).mime,
126126
"Content-Length": buffer.length,
127127
},
128128
});

package-lock.json

Lines changed: 66 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@
3636
],
3737
"dependencies": {
3838
"@types/body-parser": "^1.19.0",
39-
"@types/file-type": "^5.2.2",
4039
"@types/node": "^12.12.47",
4140
"axios": "^0.19.2",
4241
"body-parser": "^1.19.0",
43-
"file-type": "^7.7.1"
42+
"file-type": "^14.6.2"
4443
},
4544
"devDependencies": {
4645
"@types/express": "^4.17.6",

0 commit comments

Comments
 (0)