如何在 Websphere Liberty Core 17.0.0.1 中抑制 $WSEP header

How to suppress $WSEP header in Websphere Liberty Core 17.0.0.1

我在 Websphere Liberty Core 17.0.0.1 上有一个应用程序 运行。每当它以 4xx 状态代码响应时,Web 容器都会将名为 $WSEP 的 header 添加到响应中。例如:

$WSEP →
Cache-Control →no-cache, no-store, max-age=0, must-revalidate
Content-Language →en-US
Content-Type →text/html;charset=UTF-8
Date →Tue, 30 May 2017 13:21:21 GMT
Expires →0
Pragma →no-cache
Transfer-Encoding →chunked

我试图将 Web 容器 属性 suppressErrorPageODRHeader 添加到我的 server.xml 中并抑制此 header,但它不起作用。

<webContainer suppressErrorPageODRHeader="true"/>

如何配置我的 Web 容器来抑制此 header?

您应该使用完整的网络容器名称 "com.ibm.ws.webcontainer.suppresserrorpageodrheader" 并且应该禁止 $WSEP header.

某些 original/old WAS 属性在 Liberty 中没有短名称。

<webContainer com.ibm.ws.webcontainer.suppresserrorpageodrheader="true"/>