You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some digging into the Capacitor code, I think the issue is related to URLRequest and how it treats certain headers. Per Apple's documentation, certain headers are reserved and setting them will do nothing. Authorization is one of those headers but there's no other way to pass that header when using CapacitorHttp.
The text was updated successfully, but these errors were encountered:
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.
Bug Report
Capacitor Version
Platform(s)
Current Behavior
Making an HTTP request with
CapacitorHttp
and including anAuthorization
header results in the actual request to the server missing the header.Expected Behavior
All headers passed to
CapacitorHttp
should be passed to the server.Code Reproduction
I'm not sure how to set up a full replication of this since it requires a server app in addition to the client app. The client code is simple:
The behavior is the same when using
fetch()
with the plugin enabled to intercept those requests, too.Other Technical Details
npm --version
output: 8.19.1node --version
output: v16.13.2pod --version
output (iOS issues only): 1.10.1Additional Context
I asked about this issue on the Ionic Forums here.
After some digging into the Capacitor code, I think the issue is related to
URLRequest
and how it treats certain headers. Per Apple's documentation, certain headers are reserved and setting them will do nothing.Authorization
is one of those headers but there's no other way to pass that header when usingCapacitorHttp
.The text was updated successfully, but these errors were encountered: