问题
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:
AddHeadersFilter
filter 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 betweenuriSecurity
andrange
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