我在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
属性被忽略/保护?