-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix xhr.response.body.text is not a function #1
Conversation
In what case those this happen? Is it when the request has empty body? |
I guess so. |
Can you make a modification in order to still log the request but without body in case the .text method does not exist? We still would like to log the request since it is important information. |
Can I use Don't worry I added
|
I have updated my PR. |
@zhex900 I have been testing the change and the thing is like so: The response.body will be a stream in case it's the new FETCH API used. In case the old XMLHTTPREQUEST API is used then it will be either a text or a de-serialized object. You case is XMLHTTPREQUEST and that's why the text() method never exists on the body. So this means that we need a new change here:
|
Yes of course. I am now testing the changes. After you've added it I will merge it and tomorrow create a release with some tests as well. This is quite an important bug. Thanks for your contribution. |
Do you prefer using double quotes or single quotes? |
I will leave the formatting to you since I do not have a preference. 😄 |
On a separate note, I want to see the logs in the terminal even if the tests passes. How do you feel about adding an extra config option? |
Yeah sure, but let's keep this MR like so. If you'd like the feature you can create the feature request or if you want to do it yourself just create a new MR. Also I have tested your changes and they are working well, good job. |
Update to latest, merge from base repo
This a fix for this error.