Skip to content

fix: prevent JSON parsing when responseType is text#102

Open
AKN414-IND wants to merge 1 commit intodevelopit:masterfrom
AKN414-IND:fix/text-response-parsing
Open

fix: prevent JSON parsing when responseType is text#102
AKN414-IND wants to merge 1 commit intodevelopit:masterfrom
AKN414-IND:fix/text-response-parsing

Conversation

@AKN414-IND
Copy link
Copy Markdown

Currently when i tried to get the data response as a text I found i was unable to get it so i went through the code and found that this the library calls JSON.parse() on the response data regardless of the responseType configuration. This causes issues when expecting plain text or when the response body is not valid JSON.

so the logic i add just check if responseType is json else just return the normal data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant