Apply suggestion from @bitterpanda63

Adds comment about "utf8" encoding of json response.

Co-authored-by: bitterpanda <bitterpanda@proton.me>
This commit is contained in:
Sander Declerck 2025-11-24 14:49:40 +01:00 committed by GitHub
parent f7de81645c
commit e02e36cfea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,6 +53,7 @@ export function modifyNpmInfoResponse(body, headers) {
return body; return body;
} }
// utf-8 is default encoding for JSON, so we don't check if charset is defined in content-type header
const bodyContent = body.toString("utf8"); const bodyContent = body.toString("utf8");
const bodyJson = JSON.parse(bodyContent); const bodyJson = JSON.parse(bodyContent);