Skip to main content

We are getting CORS issue when sending a request from a web application client to IFS projection? is there any solution to get around this issue?

is there any way to change the response header from projection?

Thank you,

/Jeewan

Hi @khajeewak ,

CORS is a browser security feature that restricts cross-origin HTTP requests that are initiated from scripts running in the browser. 

It might be a security issue when a browser directly calls IFS REST APIs

This can be solved by creating a new server based API that calls the IFS Rest API while both are in on the same server.

Moreover, you can create a new rule into the HTTP Response header: Access-Control-Allow-Origin *

Regards

Manoj


But what if you’re on localhost on your development computer and wish to run the projections from localhost?  They cannot be on the same machine.  Where would you drop the Access-Control-Allow-Origin * entry to allow access from all domains?  On the web server? On the middle ware server?


Hi @ngCorey ,

I didn't find a place to change the http header in the MWS configurations. 

But I think for localhost you can try below

For IIS6

  1. Open Internet Information Service (IIS) Manager
  2. Right click the site you want to enable CORS for and go to Properties
  3. Change to the HTTP Headers tab
  4. In the Custom HTTP headers section, click Add
  5. Enter Access-Control-Allow-Origin as the header name
  6. Enter * as the header value
  7. Click Ok twice

Thank you @Manoj Ruwanhewa  @ngCorey