This is a question related to a problem I am dealing with right now, as described in this post.
The scenario is:
- A 3rd party webservice (over which I have no control at all), that has a CORS configuration that blocks requests with an “origin” value in the request header.
- An Ionic app that must run as both as PWA and Android app, that uses Angular HTTP client to consume that webservice.
In this scenario, the request is being blocked by the webservice CORS configuration because of the “origin” value being added to the request’s header (it seems the webservice provider is not including a “Access-Control-Allow-Origin” value in their response’s headers for CORS preflight).
The question: is there any way of remove the origin header value while using Angular HTTP client?
I am aware that using the Native HTTP client solve the problem, but only for the Android version, not the PWA version. I am also aware that for PWA version I could use a proxy to suppress or alter the origin value, but I am looking for some kind of configuration at Ionic level to solve the problem in both scenarios.