I'm rendering a local static HTML file in a WebView that needs to do cross-origin requests to a server I control. Currently those requests are failing because the "Origin" header is being set as null
by the WebView (probably because it's a local file). I've considered running a local HTTP server in the app and pointing the WebView to that, but then the "Origin" header would be set as http://localhost
. I'm reluctant to add localhost
to my CORS whitelist server-side, as I'm not sure what the security implications of that would be.
What would be the best approach to solving this problem?