我正在使用Akka HTTP 10.0.15。每个响应都包含标题Server: akka-http/10.0.15
。有什么方法可以删除此标头吗?我在指令列表中找不到任何内容。
答案 0 :(得分:1)
在您的application.conf
中,将akka.http.server.server-header
设置为空字符串:
akka.http.server.server-header = ""
akka.http {
server {
# The default value of the `Server` header to produce if no
# explicit `Server`-header was included in a response.
# If this value is the empty string and no header was included in
# the request, no `Server` header will be rendered at all.
server-header = akka-http/${akka.http.version}
...
}
...
}