Hi,
I just created a VueJS app and I’m using Capacitor to generate both iOS and Android applications.
At the begining, I was using the “fetch” javascript method to make any http requests. It worked fine.
I wanted to use CapacitorHttp because it seems to be better to use in Capacitor applications.
On iOS, I have no issue, the origin is “capacitor://localhost”
On Android though, the origin is not sent in the http request, and, then, in my server, I have “undefined” in “origin”.
I tried few things:
- Add hostname in the capacitor.config.ts => no luck
- Manually set origin during my http requests => no luck (and bad)
Here is an example of a GET request I do
CapacitorHttp.get({
url: url,
headers: headers,
webFetchExtra: { credentials: ‘include’ },
})
Someone has an idea?
Thanks,
Laurent