Commit f58c59f89f

Andrew Kelley <andrew@ziglang.org>
2024-02-11 22:54:48
std.http.Server: don't emit Server HTTP header
Let the user add that if they wish to. It's not strictly necessary, and arguably a harmful default.
1 parent 256c593
Changed files (1)
lib
std
lib/std/http/Server.zig
@@ -478,10 +478,6 @@ pub const Response = struct {
         if (res.status == .@"continue") {
             res.state = .waited; // we still need to send another request after this
         } else {
-            if (!res.headers.contains("server")) {
-                try w.writeAll("Server: zig (std.http)\r\n");
-            }
-
             if (!res.headers.contains("connection")) {
                 const req_connection = res.request.headers.getFirstValue("connection");
                 const req_keepalive = req_connection != null and !std.ascii.eqlIgnoreCase("close", req_connection.?);