I'm setting request filtering rule on IIS:
<security>
<requestFiltering>
<filteringRules>
<remove name="test" />
<filteringRule name="test" scanUrl="true" scanQueryString="true">
<scanHeaders>
<clear />
</scanHeaders>
<appliesTo>
<clear />
<add fileExtension=".aspx" />
</appliesTo>
<denyStrings>
<clear />
<add string="Demo" />
</denyStrings>
</filteringRule>
</filteringRules>
</requestFiltering>
</security>
And when I'm testing URL: https://localhost/Demo/app.aspx
rule is working, but only for first 2 times, IIS log:
2021-04-27 21:08:30 127.0.0.1 GET /Demo/app.aspx - 443 - 127.0.0.1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64;+rv:88.0)+Gecko/20100101+Firefox/88.0 - 404 19 0 78
2021-04-27 21:08:49 127.0.0.1 GET /Demo/app.aspx - 443 - 127.0.0.1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64;+rv:88.0)+Gecko/20100101+Firefox/88.0 - 404 19 0 0
2021-04-27 21:08:49 127.0.0.1 GET /Demo/app.aspx - 443 - 127.0.0.1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64;+rv:88.0)+Gecko/20100101+Firefox/88.0 - 200 0 0 31
After app pool restart filtering is again working only for first 2 requests. Did someone had similar issue? Or any suggestions?