The encoding option is not working when combined with responseType: 'json' #1988
Closed
2 tasks done
Labels
bug
Something does not work as it should
good for beginner
This issue is easy to fix
✭ help wanted ✭
Describe the bug
The
encoding
option is not working when combined withresponseType: 'json'
.Actual behavior
I created a minimal repro repo : https://github.com/baptistemarchand/got-encoding-repro/blob/main/index.mjs
What it does :
I have a dummy api that returns a JSON with the latin1 encoding : https://latin1-api.vercel.app/.
I call it twice with
got
:responseType: 'json'
=> the encoding seems to be ignoredresponseType: 'json'
and instead doing aJSON.parse
manually => encoding working as expectedHere is the result :
Expected behavior
I expected the result of both console.log to be the same. Like this :
Checklist
The text was updated successfully, but these errors were encountered: