Mock icon indicating copy to clipboard operation
Mock copied to clipboard

fix withCredentials=true

Open phillyx opened this issue 3 years ago • 0 comments

修复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()之后,并不会执行将自定义属性赋值给原生的过程

phillyx avatar May 31 '21 13:05 phillyx