문제

I have an application running on WAS 8.0.0.3 and I am trying to access that application from another machine using an ajax call (cross domain). The preflight request (OPTIONS) is failing because origin(other machine) is not allowed by Access-Control-Allow-Origin which means WAS is not configured to allow cross domain requests. I searched but could not find any configuration which can be made on WAS to support CORS. The same thing works fine on Apache tomcat by modifying tomcats config but for WAS could not get any pointer. Any idea would be appreciable.

도움이 되었습니까?

해결책

After doing analysis, it appeared that WAS on its own does not provide any provision to enable CORS in its configuration. To solve this problem, added configuration for "Acess-Control-Allow-Origin" on web server (IHS) which did the trick. So looks like web server should handle configuration required for cross domain requests in case of certain application servers like WAS.

다른 팁

If you have an Spring Application you can use @CrossOrigin to do this.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top