From 450f3bc9250eca86b470ec29c228165054016c76 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 5 Jan 2023 13:31:26 -0700 Subject: [PATCH] std.http.Class: classify out-of-range codes as server_error RFC 9110 section 15: Values outside the range 100..599 are invalid. Implementations often use three-digit integer values outside of that range (i.e., 600..999) for internal communication of non-HTTP status (e.g., library errors). A client that receives a response with an invalid status code SHOULD process the response as if it had a 5xx (Server Error) status code. --- lib/std/http.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/std/http.zig b/lib/std/http.zig index baeb7679f1..f9ac019495 100644 --- a/lib/std/http.zig +++ b/lib/std/http.zig @@ -218,7 +218,6 @@ pub const Status = enum(u10) { } pub const Class = enum { - nonstandard, informational, success, redirect, @@ -232,8 +231,7 @@ pub const Status = enum(u10) { 200...299 => .success, 300...399 => .redirect, 400...499 => .client_error, - 500...599 => .server_error, - else => .nonstandard, + else => .server_error, }; }