Can't find AddHeadersFilter in CMS Magnolia 5.7.4

左心房为你撑大大i 提交于 2021-01-29 09:18:36

问题


I can't find AddHeadersFilter in CMS Magnolia 5.7.4 This class in classpath

magnolia-core\5.7.4\magnolia-core-5.7.4.jar!\info\magnolia\cms\filters\AddHeadersFilter.class

but not accessible in Magnoia's Configuration panel.

According documentation it should be there

Any clue how to get access to this filter and configure to support CORS?

Update:

Update 2: Here is how I send request

let url = 'http://localhost:8080/en/consumer'
fetch(url, {
   mode: 'no-cors',
   headers: {
       'Content-Type': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3'//,
       //'Access-Control-Allow-Origin':'*',
   },
  method: "GET"
})
    .then(response => {
        response.text()
        })
    .then(data => {
        frame.innerHTML = data
        })

回答1:


So in summary of the comments above:

  • AddHeadersFilterfilter is not installed OOTB, you have to add it to the filter chain yourself
  • when adding AddHeadersFilter to the filter chain, make sure you position it between uriSecurity and range filter
  • to avoid issues with authentication, make sure you do testing on local public instance or if you need to test this on author instance, make sure the page you are loading is allowed for anonymous user (on author instance, by default, all pages are denied)


来源:https://stackoverflow.com/questions/58528045/cant-find-addheadersfilter-in-cms-magnolia-5-7-4

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!