How to disable http methods like put,delete,options on dispatcher in aem as cloud and allow only post and get | Community
Skip to main content
Level 3
July 1, 2024
Solved

How to disable http methods like put,delete,options on dispatcher in aem as cloud and allow only post and get

  • July 1, 2024
  • 2 replies
  • 1836 views

Hi All,

 

Please anyone cloud help me with the fix as i am not sure how to disable these methods on dispatcher.

 

Need to disable  put,options,head,patch,delete and allow only post and get methods on dispatcher.

 

 

 

 

 

  • Regards,

 

Mahesh

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi @smahesh 
Please check examples : https://medium.com/@toimrank/aem-dispatcher-filter-section-a8c03a92c256 

 

/filters { # Allow other URLs as needed /0001 { /type "deny" /url "/*" } # Deny everything else by default /0002 { /type "allow" /method "GET" /url "/content/*" } #example of POST but specify further to only allow desire url with extensions /0003 { /type "allow" /method "POST" /url "/content/*" } }

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
July 1, 2024

Hi @smahesh 
Please check examples : https://medium.com/@toimrank/aem-dispatcher-filter-section-a8c03a92c256 

 

/filters { # Allow other URLs as needed /0001 { /type "deny" /url "/*" } # Deny everything else by default /0002 { /type "allow" /method "GET" /url "/content/*" } #example of POST but specify further to only allow desire url with extensions /0003 { /type "allow" /method "POST" /url "/content/*" } }
Arun Patidar
smaheshAuthor
Level 3
July 1, 2024

Thanks @arunpatidar , but how can I disable these methods from dispatcher headers ? Please let me know.

 

 

arunpatidar
Community Advisor
Community Advisor
July 1, 2024

Hi @smahesh 
I did not understood the logic of using dispatcher headers to disable certain Methods? Could you please elaborate.

You can disable above from filter section

https://experienceleague.adobe.com/en/docs/experience-manager-dispatcher/using/configuring/dispatcher-configuration#defining-a-filter 

 

Arun Patidar
EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 2, 2024

Hi @smahesh 


What @arunpatidar mentioned is the way to disable methods in the dispatcher. You "filter" which type of request (by method type) are allowed to pass through the dispatcher, so by setting the Rules Arun posted you are saying  Denying all requests except those GET and POST requests to the "/content" path. The headers have nothing to do with these configurations, maybe you are trying to ask something different, if so, please clarify. 

Hope this helps

Esteban Bustamante