Commit 450f3bc925

Andrew Kelley <andrew@ziglang.org>
2023-01-05 21:31:26
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.
1 parent ba1e53f
Changed files (1)
lib
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,
         };
     }