X-Requested-With的IIS阻止请求

时间:2015-03-23 00:38:43

标签: iis iis-7 iis-7.5

如果标题X-Requested-With不包含单词" ShockwaveFlash",我想阻止任何请求。我非常吟游诗人,有谁可以帮我这个?以下是我尝试过的内容:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="RequestBlockingRule1" patternSyntax="Wildcard" stopProcessing="true">
                    <match url="*" />
                    <conditions>
                        <add input="{HTTP_X_Requested_With}" pattern="^Shockwave$" />
                    </conditions>
                    <action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

0 个答案:

没有答案
相关问题