Post method with html extensions | Community
Skip to main content
Level 3
Feb 16, 2021 10:36 AM UTC
Solved

Post method with html extensions

Hi All,

I need to block my post configuration on aem dispatcher first and allow only required selectors with extensions on the dispatcher filters.

So, could you please suggest on the way or whether the below filter will allow the post method with html extensions for configuring into the dispatcher.

 

//001 { /type "allow" /method "POST" /url "/content/[.]*.html}

Thanks in advance.

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Sanket_Kumbharkhane
Sanket_KumbharkhaneAccepted solution
Level 4
Feb 16, 2021 11:40 AM UTC

Hi @keerthi97 ,

 

if you use the below 1st rule in your filters. any file

/0001 { /type "deny"  /url "*" }

It will deny everything for you including Get and Post [comes as the best practices]

 

and after that, you can allow POST requests.

 

Here are few examples to allow the post method with html & json extension

## allow POSTs to form selectors under content

/0002 { /type "allow" /method "POST" /url "/content/[.]*.form.html" }

 

## allow POSTs to update the shopping cart

/0003 { /type "allow" /method "POST" /path "/content/[.]*.commerce.cart.json" } 

 

 

/filter { /0001 { /type "deny" /url "*" } /0002 { /type "allow" /method "POST" /url "/content/[.]*.form.html" } /0003 { /type "allow" /method "POST" /path "/content/[.]*.commerce.cart.json" } }

 

 

5 replies

Level 2
Mar 4, 2021 12:57 PM UTC

Hi @sanket_kumbharkhane ,

In my scenario, I am having post servlet calls modified in the form of resource types instead of /bin/, so could you please suggest some filters to refine and allow the POST servlets present in my project. Also , there are no identical selectors used in forms present in my application.

 

Thanks for your help

Translate
Sanket_Kumbharkhane
Sanket_KumbharkhaneAccepted solution
Level 4
Feb 16, 2021 11:40 AM UTC

Hi @keerthi97 ,

 

if you use the below 1st rule in your filters. any file

/0001 { /type "deny"  /url "*" }

It will deny everything for you including Get and Post [comes as the best practices]

 

and after that, you can allow POST requests.

 

Here are few examples to allow the post method with html & json extension

## allow POSTs to form selectors under content

/0002 { /type "allow" /method "POST" /url "/content/[.]*.form.html" }

 

## allow POSTs to update the shopping cart

/0003 { /type "allow" /method "POST" /path "/content/[.]*.commerce.cart.json" } 

 

 

/filter { /0001 { /type "deny" /url "*" } /0002 { /type "allow" /method "POST" /url "/content/[.]*.form.html" } /0003 { /type "allow" /method "POST" /path "/content/[.]*.commerce.cart.json" } }

 

 

Translate
Keerthi97Author
Level 3
Feb 16, 2021 11:44 AM UTC

Thanks for your answer @sanket_kumbharkhane 

Translate