From 9c542218ecb60b61bd9774d6fbed893b91546a08 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 26 Nov 2025 23:04:41 +0100 Subject: [PATCH] http.requestHasBody: a PUT response can have a body MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HEAD/TRACE are bodyless, but PUT responses are body-capable per RFC 7231. --- lib/std/http.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/http.zig b/lib/std/http.zig index eedd729576e0..a768372eccae 100644 --- a/lib/std/http.zig +++ b/lib/std/http.zig @@ -44,8 +44,8 @@ pub const Method = enum { /// Actual behavior from clients may vary and should still be checked pub fn responseHasBody(m: Method) bool { return switch (m) { - .GET, .POST, .DELETE, .CONNECT, .OPTIONS, .PATCH => true, - .HEAD, .PUT, .TRACE => false, + .GET, .POST, .PUT, .DELETE, .CONNECT, .OPTIONS, .PATCH => true, + .HEAD, .TRACE => false, }; }