Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

HTTP Request Origins set to LocalHost #137

Closed
ehorodyski opened this issue May 18, 2017 · 3 comments
Closed

HTTP Request Origins set to LocalHost #137

ehorodyski opened this issue May 18, 2017 · 3 comments

Comments

@ehorodyski
Copy link

This plugin looks like it changes the HTTP request origin header from file:// to localhost:8080. This is breaking a lot of calls I'm trying to make to APIs that are not CORS enabled, and do not whitelist localhost as an entry.

Can anyone provide some insight?

@manucorporat
Copy link

manucorporat commented May 19, 2017

It is not possible to bypass CORS in WKWebView. You have to implement CORS in your server whitelisting localhost:8080 or you can use the HTTP cordova plugin https://ionicframework.com/docs/native/http/

I recommend to implement CORS in your server though

@JiaLiPassion
Copy link

JiaLiPassion commented May 19, 2017 via email

@ehorodyski
Copy link
Author

@manucorporat -- Would it come into consideration to let consumers decide to mask their origins, from null or localhost to something configurable?

There are many APIs available that are not CORS enabled that this plugin is preventing us from using. When building for web there's many options to proxy to mask localhost as origin, but we've found a lot of 3rd party APIs we want to use are blocking based on origin.

Then it's like, do we drop the plugin, and lose the latest web advances (like display:sticky in some cases, and Ionic's infinite scroll), or try to create a wrapper around an API, congesting the end-user.

Is there a win-win scenario where I can call Yelp and have Ionic Sticky Headers too?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants