cancel
Showing results for 
Search instead for 
Did you mean: 

How to resolve CORS issue for calling non-sap API on-premise?

kriti_bafna1990
Explorer
0 Kudos

Hi All,

I am trying to call a non-sap api using ajax which works fine from Cloud(setting a destination on SCC/BTP) but not when its deployed to on-premise FLP.

We added 'Access-Control-Allow-Origin' header response parameter in service API but still no luck.

Is there any issue in UI5 that it requests a preflight call internally?

Let me know if anyone had similar issue.

Thanks in advance!

Regards

Kriti

Abhi9
Explorer
0 Kudos

Hi Kriti,

Did you find any solution for your query ?

Regards,

Abhinay

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member194549
Contributor
0 Kudos

Hi krbafna,

As far as I know, the Access-Control-Allow-Origin header must be set in the main request, i.e. in the first request (index.html / launchpad.html).
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

If you use a WebDispatcher in your onPrem setup, it might be possible that it proxies the request.

Regards
Simon