ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.29k stars 1.01k forks source link

feat(ios): return secure cookies on local scheme #7733

Open gjb-amazon opened 1 month ago

gjb-amazon commented 1 month ago

This PR reworks the CapacitorCookieManager.getServerUrl method to modify the URL if it uses the scheme for serving local assets. By swapping the scheme to https, this allows calls to HTTPCookieStorage to return secure cookies when asking for cookies with the result of getServerUrl.

Happy to have a discussion here on this change. This is more or less a reference implementation to hopefully better convey what I'm expressing in https://github.com/ionic-team/capacitor/discussions/7690.