lundi 27 novembre 2017

How to deal with CORs re-directing to Proxy Server

I have a web application that makes a request to a 3rd party api server. This is normally fine, as the 3rd party server has set it's headers properly for CORs. However, I have clients who sit behind a proxy. So all the requests to this 3rd party server gets re-directed and the returned response from the proxy server does not have the headers set up correctly for CORs.

I get this error: Failed to load http://ift.tt/2zvcV3v&types=country,region,place: Redirect from 'http://ift.tt/2zvcV3v&types=country,region,place' to 'http://ift.tt/2AgGyH3' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8787' is therefore not allowed access.

Should the onus be on the client to configure their proxy correctly, or should developers be responsible to figure out a way through this situation?




Aucun commentaire:

Enregistrer un commentaire