You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the current behavior?
The script throws exception when sending post request on mock scene.
Inspecting stack trace of the error, the util function getStringByteLength in src/Utils.js seems using the native Blob to get the length of a string.
馃Step to reproduce
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
// inject mock-xmlhttprequest somewhere.constformData=newFormData();formData.append('name','some string in form');axios.post('https://google.com/',formData,{},{});
What is the expected behavior?
Maybe it should not throw the error? Environment in which you encounter the issue:
mock-xmlhttprequest version: 7.0.4
Chrome version: Version 103.0.5060.114 (Official Build) (x86_64)
OS version: MacOS Big Sur
Did this work in a previous version of mock-xmlhttprequest (which)?
Have no idea about previous version of mock-xmlhttprequest. Do you intend to provide a pull request to address this issue?
馃毀fixing PR
The issue is clear: we should use new Blob([string], {type: 'text/plain'}); to create a Blob according to latest MDN document, I'm creating an PR for this bugfix.
The text was updated successfully, but these errors were encountered:
Is this issue a feature request or a bug report?
馃悰Bug Report
What is the current behavior?
The script throws exception when sending post request on mock scene.
Inspecting stack trace of the error, the util function
getStringByteLength
insrc/Utils.js
seems using the native Blob to get the length of a string.馃Step to reproduce
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
What is the expected behavior?
Did this work in a previous version of mock-xmlhttprequest (which)?
Have no idea about previous version of mock-xmlhttprequest.
Do you intend to provide a pull request to address this issue?
馃毀fixing PR
The issue is clear: we should use
new Blob([string], {type: 'text/plain'});
to create a Blob according to latestMDN document, I'm creating an PR for this bugfix.
The text was updated successfully, but these errors were encountered: