From f58c59f89f9c49b29facf91937d9d78785824378 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 11 Feb 2024 14:54:48 -0700 Subject: [PATCH] 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. --- lib/std/http/Server.zig | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/std/http/Server.zig b/lib/std/http/Server.zig index 4659041779..ab46fdcc4c 100644 --- a/lib/std/http/Server.zig +++ b/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.?);