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]: 3xx status code response through error when using it with fetch API #7659

Open
1 of 3 tasks
Ammar1999y opened this issue Sep 15, 2024 · 0 comments
Open
1 of 3 tasks
Labels

Comments

@Ammar1999y
Copy link

Capacitor Version

Latest Dependencies:

@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2

Installed Dependencies:

@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2

[success] Android looking great! �

Other API Details

npm --version: 10.2.5
node -v: v20.11.1

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

When I send a request to my server using fetch, the server get the request then send a response with 3xx status code, then the client throws TypeError: Failed to fetch, it's like adding redirect: "error" to the fetch request. However, when I use CapacitorHttp, everything works fine. I already have a website for my app, and everything works fine there. Did I do something wrong, or does fetch in Capacitor not handle 3xx status codes properly?

Expected Behavior

when using fetch api, and get response with 3xx status codes, the fetch api should not through error

Project Reproduction

https://github.com/Ammar1999y/fetch-error/blob/main/pages/_app.tsx

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant