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]: NativeBridge doesn't pass responseType to native HTTP #7445

Closed
2 of 3 tasks
SillyButt opened this issue May 2, 2024 · 3 comments
Closed
2 of 3 tasks

[Bug]: NativeBridge doesn't pass responseType to native HTTP #7445

SillyButt opened this issue May 2, 2024 · 3 comments
Labels

Comments

@SillyButt
Copy link
Contributor

Capacitor Version

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

Other API Details

npm: 10.5.0
node: 20.9.0

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

When using http requests via patched by Capacitor's native-bridge XHR/Fetch with expected responseType, the Bridge doesn't pass responseType to Native HTTP (Android/iOS). This leads to Native HTTP to not process the data with expected response type.

Example:
A request with responseType: 'blob' will not be treated by native HTTP as Blob and encoded to base64 rather than a plain string, despite responseType to be expected in native bridges code on Android and iOS side.

Expected Behavior

Requests with responseType: 'blob' should return Blob with valid type.

Project Reproduction

https://github.com/SillyButt/capacitor-response-type-bug-reproduction

Additional Information

A convenient visualization of the code flow
CleanShot 2024-05-02 at 11 58 52@2x

@jcesarmobile
Copy link
Member

This is not reproductible in Capacitor 5.7.5 nor 6.0.0, please, when reporting issues make sure you are using latest version.

@jcesarmobile jcesarmobile closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
@SillyButt
Copy link
Contributor Author

SillyButt commented May 23, 2024

Do you have a PR or commit to back up the statement? I don't see any commit regarding the topic with changes that fix this.
I tried to reproduce the issue on V6 in dummy project, but couldn't succeed because bridge doesn't forward the request to NativeHttp anymore (because of new implementation of isRelativeOrProxyUrl that intercepts that).
But the issue is definitely actual on my private project, it can be also easily visible by looking at codebase.

CleanShot 2024-05-23 at 15 25 18@2x

Copy link

ionitron-bot bot commented Jun 22, 2024

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jun 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants