mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
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.
This commit is contained in:
parent
ba1e53f116
commit
450f3bc925
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user