zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 450f3bc9250eca86b470ec29c228165054016c76 (tree)
parent ba1e53f116b27f97828d495af2ea5b87fd9632cb
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Thu,  5 Jan 2023 13:31:26 -0700

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.

Diffstat:
Mlib/std/http.zig | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git 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, }; }