Commit 854774d468

Frank Denis <github@pureftpd.org>
2025-11-26 23:04:41
http.requestHasBody: a PUT response can have a body
HEAD/TRACE are bodyless, but PUT responses are body-capable per RFC 7231.
1 parent a1827d5
Changed files (1)
lib
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,
         };
     }