Remove the HTTP Server header in Jetty 9

前端 未结 7 1925
执念已碎
执念已碎 2020-12-30 01:36

This is how you hide the server version in Jetty 8:

Server server = new Server(port);
server.setSendServerVersion(false);

How do you do it

7条回答
  •  Happy的楠姐
    2020-12-30 02:06

    There is now an HttpConfiguration object with that setting on it.

    org.eclipse.jetty.server.HttpConfiguration

    Look to the jetty.xml for the section on http configuration section showing how to setup the object and then the jetty-http.xml file which shows how that configuration is used. Remember that the jetty xml files are really just a thin skin over java and work basically the same.

    http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-server/src/main/config/etc/jetty.xml

    http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-server/src/main/config/etc/jetty-http.xml

提交回复
热议问题