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

Add FormData type for data in fetchSyncPost #10715

Closed
3 tasks done
frostime opened this issue Mar 24, 2024 · 0 comments
Closed
3 tasks done

Add FormData type for data in fetchSyncPost #10715

frostime opened this issue Mar 24, 2024 · 0 comments
Assignees
Milestone

Comments

@frostime
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

fetchSyncPost 在实现中,对于一切 data 参数不加区分地设定为 json 类型,但是后端 API 中,有些请求(如 upload, putFile 等)的body的类型是 HTMLForm。所以在使用这个 API 发这些请求的时候会出现错误。

见:

if (data instanceof FormData) {

和:

if (data) {

Expected result

请修复 fetchSyncPost 的实现,让其对不同类型更加鲁棒。

Screenshot or screen recording presentation

No response

Version environment

- Version: 3.0.4
- Operating System: win10
- Browser (if used): No

Log file

More information

No response

@frostime frostime changed the title Bug | 插件 API fetchSyncPostdata 参数不能只是 json Bug | 插件 API fetchSyncPostdata 参数类型问题 Mar 24, 2024
@Vanessa219 Vanessa219 self-assigned this Mar 24, 2024
@Vanessa219 Vanessa219 added this to the 3.0.5 milestone Mar 24, 2024
Vanessa219 added a commit that referenced this issue Mar 24, 2024
@Vanessa219 Vanessa219 changed the title Bug | 插件 API fetchSyncPostdata 参数类型问题 Add FormData type for data in fetchSyncPost Mar 24, 2024
@88250 88250 changed the title Add FormData type for data in fetchSyncPost Add FormData type for data in fetchSyncPost Mar 25, 2024
@88250 88250 changed the title Add FormData type for data in fetchSyncPost Add FormData type for data in fetchSyncPost Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants