How to define CORS in Websphere Application Server Liberty Profile V8.5

前端 未结 4 1211
遥遥无期
遥遥无期 2021-02-02 00:18

Is it possible to apply cross-origin resource sharing (CORS) in a Websphere Application Server Liberty Profile V8.5 ?

I searched the redbook but couldn\'t find IBM menti

4条回答
  •  情歌与酒
    2021-02-02 00:41

    Starting with the January 2016 Beta (edit: and now in Liberty 8559), WebSphere Liberty supports CORS natively. You just configure the server.xml with the CORS options you want, here's an example:

    
    

    The domain attribute is for the application root that you want this configuration to apply to, which means it won't affect any other context roots. The other 7 attributes follow exactly the official CORS spec (https://www.w3.org/TR/cors/), so they are pretty self explanatory.

    Link to beta: https://developer.ibm.com/wasdev/blog/2016/01/15/beta-websphere-liberty-and-tools-january/

提交回复
热议问题