-
Notifications
You must be signed in to change notification settings - Fork 1k
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: CapacitorHttp XMLHttpRequest (Angular HttpClient) interceptor doesn't pass headers correctly #6274
Comments
Same issue here, apparently overwrites all request even |
Having similar issue using |
I'm also pointing the finger at PR #6251 for breaking http calls. App works fine in 4.6.2 but server gets bad/missing info on 4.6.3. |
Since its Native → Browser it could be due to Access-Control-Expose-Headers. Can you try adding that to your server and select the headers you want to expose to the client? |
This change breaks passing headers in iOS 028c556#diff-73da2144bc5fefb384b6fc1501a8efbabac7cfdf2faa411b68cdd113f53d884dL430-R432 JSON.stringify headers makes headers become a String, but in native part of iOS, it expect headers is a hash table ([String: String]) |
Resolved on #6303 |
Bug Report
Capacitor Version
Platform(s)
Android and iOS
Current Behavior
When using Angular's HttpClient in combination with Capacitor's
CapacitorHttp
intercepting enabled, headers are sent incorrectly to the server.Here's what it looks like on Android (did remote debugging to get some more details):
Note that the
headers
are a JSON-encoded string whenCapacitorHttp
is interceptingXMLHttpRequest
. That doesn't seem right!And here's what it looks like on iOS:
Expected Behavior
I expect Angular's HttpClient to work correctly in combination with
CapacitorHttp
'sXMLHttpRequest
interceptor.Code Reproduction
Here's the full codebase of my screenshots above: https://github.com/dennisameling/capacitor-http-bug
Other Technical Details
npm --version
output: 8.19.2node --version
output: v16.18.1pod --version
output (iOS issues only): 1.11.2Additional Context
The text was updated successfully, but these errors were encountered: