1

I've got an ionic 3 hybrid/cordova app that uses the cordova-plugin-ionic-webview plugin (which will use WKWebView in iOS). I've historically always used an old version of this plugin due to compatibility issues (@1.2.1). Suddenly today, new builds started having issues where my app was sending origin: null for the origin headers on http requests. I've read of others having this issue too, but it's clear by the docs that this plugin has had iterations of doing other flavors of origins (but not null).

I decided to upgrade and see what happened. I upgraded to the latest 2.x version (@2.3.1). I got the same result. I then removed this plugin (which I believe uses a non-WkWebView webview), and everything works again, but I want to use this plugin for the performance benefits.

Up until today I believe the origin was always http://localhost:8080 on iOS. Has anyone else seen the origin get set to null with this plugin? Any ideas why or how to fix it?

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
BRass
  • 3,698
  • 2
  • 28
  • 46
  • In case it helps, one added variable for me is I recently upgraded to xcode 10. This did require me to use the `UseModernBuildSystem` build flag (set to 0). Not sure if that impacts this at all? – BRass Jan 07 '19 at 16:44
  • More info. I tried with 3.0.0 and am still getting a null origin sent. I also tried on an older Mac with xcode 9, and tried on another ios device. All are sending a null origin. Not sure how to track down why. – BRass Jan 07 '19 at 19:53

1 Answers1

1

I tracked this down to an incompatibility with the 1.11.16 version of the cordova-plugin-code-push plugin. Seems that this plugin is stepping on the origin when the cordova-plugin-ionic-webview plugin is used. This is a fairly recent change - not sure which version made this start happening. The 1.11.14 and 1.11.16 releases both note messing with the ionic wkwebview plugin support.

I opened an issue here: https://github.com/Microsoft/cordova-plugin-code-push/issues/489

BRass
  • 3,698
  • 2
  • 28
  • 46