We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
未做mock的请求将发往服务端, 但发现cookie/session没有带上. 是否有选项设置? 还是bug?
version: 1.0.8 node version 12.13.1 windows开发环境.
The text was updated successfully, but these errors were encountered:
跟踪了代码, 出错原理搞清楚了: 由xhr.withCredentials属性设置无效导致
xhr = new XMLHttpRequest(); xhr.withCredentials = true; // 设置到 MockXMLHttpRequest上了, 并没有到真正的内部this.custom.xhr对象上
Mock.setup中未开放相关设置, 我最终是这样来临时解决(绕过)的:
Mock.XHR.prototype.withCredentials = true
希望能彻底解决此问题, 不用加hack代码, 一个思路是, 在MockXMLHttpRequest(src/mock/xhr/xhr.js)中是否可将withCredentials做成一个属性(带get/set方法的那种)
Sorry, something went wrong.
No branches or pull requests
未做mock的请求将发往服务端, 但发现cookie/session没有带上.
是否有选项设置? 还是bug?
version: 1.0.8
node version 12.13.1
windows开发环境.
The text was updated successfully, but these errors were encountered: