Skip to content

Commit

Permalink
* xover.Response - added condition for charsets with encoding problem…
Browse files Browse the repository at this point in the history
…s with toJSON
  • Loading branch information
uriel-online committed Apr 20, 2024
1 parent 4c77b64 commit 4281bb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xo.js
Original file line number Diff line number Diff line change
Expand Up @@ -8427,7 +8427,7 @@ xover.Response = function (response, request) {
//await response.json().then(json => body = json);
await response.text().then(text => body = text);
responseContent = body;
} else if (contentType.toLowerCase().indexOf("json") != -1) {
} else if (contentType.toLowerCase().indexOf("json") != -1 && charset.indexOf("iso-8859-1") == -1) {
responseContent = await response.json();
body = JSON.stringify(responseContent);
} else if (contentType.toLowerCase().split("/")[0].includes("image", "video", "audio") && ((((this.settings || {}).headers || new Headers({})).get("accept") || contentType).split(/\s*,\s*/ig)).includes(contentType)) {
Expand Down

0 comments on commit 4281bb3

Please sign in to comment.