OpenShift: Access-Control-Allow-Origin set by the server for a GET request disappears on the way back

I had strange behavior in OpenShift. I am running a REST application on OpenShift that has the CORS filter enabled to set the Access-Control-Allow-Origin header. This works fine on local jboss for all requests and OpenShift for all requests, but GET.

For some reason, when a GET request is issued, this happens. Jbossas receives the request and the application sets the header Access-Control-Allow-Origin (this has been verified with remote debugging). But the answer that I get on the caller side does not contain a header. Something on the way back removes the header.

What could be the cause or how to fix it?

+4
source share
1 answer

HTTP requests for transfers in OpenShift Online go through a reverse proxy (apache), so it is possible that the header is deleted when it is returned through the proxy.

+3
source

Source: https://habr.com/ru/post/1542810/


All Articles