Search code examples
angularsingle-page-applicationangular-httpclientprogressive-web-apps

PWA Cors request in SPA


I am working on a simple web application with angular 5 that will take banking exchange rates and make calculation for the user in the currency that he requires. The banking site does not have cors enabled. Is there a way in PWA to side step the cors issue without making a proxy ?

For the get request I use http client from '@angular/common/http' library.


Solution

  • Below is a quote from Google PWA docs on Cross-domain/cross-origin request.

    Custom headers on cross-origin requests must be supported by the server from which the resource is requested.

    If your bank blocks the cross-origin requests, you can't do anything about it. They want to secure their resources only for their domain.

    Hope it helps.