如何使用 tukey url 重写过滤器 xml 文件在响应标头中设置原始值或引用值。
直接在 set 标签中访问%{origin}
不起作用,但在条件标签中不起作用。
下面是我试过的例子。
<rule enabled="true" last="false" match-type="regex">
<name>Enabling CORS Headers</name>
<from>^/path/someMorePath.*$</from>
<condition name="origin" operator="equal">http://www.testsite.com</condition> <!-- would like to write some regex to match a set of sites and if matched, then set the same origin as response -->
<set type="response-header" name="Access-Control-Allow-Origin">%{origin}</set>
<set type="response-header" name="Access-Control-Allow-Credentials">true</set>
</rule>