From 854774d468b0a439def7eef73c544ac8d64f1b62 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 eedd729576e0e58648b8e487fc8f2af6a90d35e5..a768372eccae6c7a61f510106c05d52c1bc1daa7 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, }; } -- 2.54.0