IIS URL重写:formaction自定义标记属性被忽略

问题描述 投票:1回答:1

我在IIS ASP.Net Core 2.2 Web服务器(IIS版本8.5.9600.16384)上有一个简单的出站URL重写规则:

<outboundRules>
    <clear />
    <rule name="CustomTags" preCondition="" stopProcessing="true">
        <match filterByTags="CustomTags" customTags="Misc" pattern="(.*)" />
        <conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
        <action type="Rewrite" value="Hello world!" />
    </rule>
    <customTags>
        <tags name="Misc">
            <tag name="button" attribute="formaction" />
            <tag name="input" attribute="formaction" />
            <tag name="input" attribute="type" />
            <tag name="div" attribute="class" />
        </tags>
    </customTags>
</outboundRules>

使用html代码上的规则:

<div class="card"></div>
<input type="submit" value="My button" formaction="/path-to-some-page" />
<button class="btn" type="button" formaction="/path-to-some-page">My button</button>

我得到以下重写:

<div class="Hello world!"></div>
<input type="Hello world!" value="My button" formaction="/path-to-some-page" />
<button class="btn" type="button" formaction="/path-to-some-page">My button</button>

除基于属性formaction的标记外,所有其他定制标记均按预期重写。

问题:为什么formaction属性被忽略/保护?

url-rewriting iis-8.5
1个回答
1
投票
© www.soinside.com 2019 - 2024. All rights reserved.