JMart 的答案是正确的,但需要将文件添加到您的 Web 应用程序 ( undertow-handlers.conf
)。使用 WildFly 19.1 ( WFLY-13003 ) 及更高版本,您可以在 WildFly 中配置此功能,standalone.xml
如下所示:
<subsystem xmlns="urn:jboss:domain:undertow:12.0" ...>
<server name="default-server">
...
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<http-invoker http-authentication-factory="application-http-authentication"/>
<!-- add the filter defined below -->
<filter-ref name="samesite-cookie"/>
</host>
</server>
...
<filters>
<!-- configure samesite handler -->
<expression-filter name="samesite-cookie" expression="samesite-cookie(mode=strict)"/>
</filters>
</subsystem>
Run Code Online (Sandbox Code Playgroud)
这可以通过 WildFly 的 CLI 界面执行以下命令来实现:
/subsystem=undertow/configuration=filter/expression-filter=samesite-cookie:add(expression="samesite-cookie(mode=strict)")
/subsystem=undertow/server=default-server/host=default-host/filter-ref=samesite-cookie:add
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4733 次 |
最近记录: |