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
Add a section in the capactitor config for headers to be used by the capacitor Http plugin, similar to User Agent config.
Platforms
iOS
Android
Web
Request or proposed solution
I'm happy to do the changes for it if it something the maintainers would like to implement. I'm suggesting it as we have had to do it at work so requests to one of our APIs work.
In the capacitor configuration, something like this:
convertBody(body).then(({ data, type, headers })=>{// Example based on the patch I wrote for our app:otherheaders={
...customHeaders,// From cap config
...otherHeaders}...
Alternatives
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Im also looking for a way to add a consistent Origin header in requests on android (not tested on ios yet) made from the foreground as well as the background threads.
As far as I have observed, capacitor adds the server.hostname of the config as Origin, but only in get requests made by the foreground thread. For example, a post request delegated to the thread pool will not have an Origin header set at all (and unfortunately it will not pick the one defined in the fetch request options).
Have you experienced this and found a workaround for the origin header?
Description
Add a section in the capactitor config for headers to be used by the capacitor Http plugin, similar to User Agent config.
Platforms
Request or proposed solution
I'm happy to do the changes for it if it something the maintainers would like to implement. I'm suggesting it as we have had to do it at work so requests to one of our APIs work.
In the capacitor configuration, something like this:
Then in native-bridge:
Alternatives
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: