내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

AEM6.5.12: Block OPTIONS method call in an AEM Author and Publish Instance

Avatar

Level 1

Hi Team,

 

Our AEM Author and Publish instance is allowing OPTIONS method calls and we need to disable that. Can you please help with this, repeating we need to disable on Author and Publish Instance, we already did it with the dispatcher, but couldn't find any way to disable it on instances (Publish & Author). We put the options method in filter.methods in referrer filter but it seems not working. 

 

Thanks

Mujeeb

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 9

Hello,

 

AEM servers doesn't allow to disable OPTIONS method call by default and i think there is already reply to access to custom way.

 

Curious to understand the reason behind making such request?? because you already have dispatcher to secure the traffic. also refer https://stackoverflow.com/questions/29954037/why-is-an-options-request-sent-and-can-i-disable-it which describe really well the flow.

 

Thanks!!

원본 게시물의 솔루션 보기

3 답변 개

Avatar

Community Advisor

Hi @MujeebUrRehman 

 

Similar query is answered here: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-block-http-options-...

 

Hope it helps!

Thanks,
Kiran Vedantam.

Avatar

Community Advisor

@MujeebUrRehman  Seems we don't have any OOTB feature to disable the HTTP Methods. We can do by using a servlet filter to check the incoming request and reject any requests with the Options

 

Servlet filter :

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class DisableOptionsFilter implements Filter {
public void init(FilterConfig config) throws ServletException {}

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
if (((HttpServletRequest) request).getMethod().equalsIgnoreCase("OPTIONS")) {
((HttpServletResponse) response).sendError(HttpServletResponse.SC_FORBIDDEN);
} else {
chain.doFilter(request, response);
}
}

public void destroy() {}
}

And below is the OSGi

 

import org.osgi.service.component.annotations.Component;

import javax.servlet.Filter;

@Component(
service = Filter.class,
property = {
"sling.filter.scope=REQUEST",
"sling.filter.pattern=(/.*)(\\.(html|json|xml))?($|/.*)"
}
)
public class DisableOptionsFilterConfig extends DisableOptionsFilter {}

 

Avatar

정확한 답변 작성자:
Level 9

Hello,

 

AEM servers doesn't allow to disable OPTIONS method call by default and i think there is already reply to access to custom way.

 

Curious to understand the reason behind making such request?? because you already have dispatcher to secure the traffic. also refer https://stackoverflow.com/questions/29954037/why-is-an-options-request-sent-and-can-i-disable-it which describe really well the flow.

 

Thanks!!