4

Cordova app sends file:// as Origin header.

Of course, since the app is being loaded from the filesystem, this behavior is not too surprising.

However, our backend correctly refuses this origin. See for example: https://github.com/playframework/playframework/issues/5193

This answer suggests that Cordova apps should not be sending the file:// Origin header, which would work correctly:

Cross-domain policy does not apply to PhoneGap (for a variety of reasons, basically because your app is essentially running off the file:// URI on-device).

We are using the whitelist plugin, but that does not prevent the Origin: file:// header from being sent to the server.

It would be ideal for us if Cordova just didn't send the Origin header at all. Can it be configured this way?

sideshowbarker
  • 72,859
  • 23
  • 167
  • 174
Daniel Birowsky Popeski
  • 7,726
  • 10
  • 50
  • 110

1 Answers1

0

If it's not too late, you could always switch to https://github.com/wymsee/cordova-HTTP.

mitsest
  • 306
  • 3
  • 19