Skip to content

Commit 373a55f

Browse files
committed
Use TextDecoder over Buffer
Related issue: #133
1 parent 23d1224 commit 373a55f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/utils/retrieve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default async (url, options = {}) => {
7777
}
7878
const contentType = res.headers.get('content-type')
7979
const buffer = await res.arrayBuffer()
80-
const text = buffer ? Buffer.from(buffer).toString().trim() : ''
80+
const text = buffer ? new TextDecoder().decode(buffer).trim() : ''
8181

8282
if (/(\+|\/)json/.test(contentType)) {
8383
try {

0 commit comments

Comments
 (0)