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

[BUG][插件扩展] superagent 无法正常工作 #575

Open
foxxorcat opened this issue Jun 11, 2024 · 5 comments
Open

[BUG][插件扩展] superagent 无法正常工作 #575

foxxorcat opened this issue Jun 11, 2024 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@foxxorcat
Copy link

foxxorcat commented Jun 11, 2024

Description(required)

  1. 实现的XMLHttpRequest中的getResponseHeader方法有误,搜索的报文名应该不区分大小写。
    go默认是大写开头,superagent用的是全小写。(使用axios时设置cookie头会报错可能是这个问题???
  2. 只实现 globalThis ,但superagent使用的是window或self。(这个问题应该是superagent的???

暂时解决方法

  1. 指定 getXHR
superagent.getXHR = () => new XMLHttpRequest()

App Version(required)

1.5.7

@monkeyWie
Copy link
Member

无法正常工作的具体表现是怎么样的呢

@monkeyWie monkeyWie added the bug Something isn't working label Jun 11, 2024
@foxxorcat
Copy link
Author

superagent 自带的解析会根据content-type来执行,因为这个问题无法获取到content-type,导致自动解析不会执行,此时body == null,后续对body的操作全部报错。

@monkeyWie
Copy link
Member

monkeyWie commented Jun 11, 2024

懂了,这块请求头和响应头处理确实有问题,有兴趣来个pr修复下吗

@foxxorcat
Copy link
Author

这个是小问题,就不pr了。安装环境也是费点时间的。。。

@monkeyWie monkeyWie added this to the v1.5.8 milestone Jun 11, 2024
@monkeyWie
Copy link
Member

嗯,等我有空搞下,感谢反馈!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants