Skip to content
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 withCredentials=true #450

Open
wants to merge 1 commit into
base: refactoring
Choose a base branch
from

Conversation

phillyx
Copy link

@phillyx phillyx commented May 31, 2021

修复xhr.withCredentials = true 不生效的bug
下方写法不生效

      const xhr = new XMLHttpRequest()
      xhr.open('GET', url)
      xhr.withCredentials = true
      xhr.send()

xhr.withCredentials = true写在xhr.open()之前生效,是因为下方node_modules/mockjs/src/mock/xhr/xhr.js line226行for循环在起作用

同理,将xhr.withCredentials = true写在xhr.open()之后,并不会执行将自定义属性赋值给原生的过程

fix withCredentials=true
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