Skip to content

Commit 450f3bc

Browse files
committed
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 commit 450f3bc

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/std/http.zig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ pub const Status = enum(u10) {
218218
}
219219

220220
pub const Class = enum {
221-
nonstandard,
222221
informational,
223222
success,
224223
redirect,
@@ -232,8 +231,7 @@ pub const Status = enum(u10) {
232231
200...299 => .success,
233232
300...399 => .redirect,
234233
400...499 => .client_error,
235-
500...599 => .server_error,
236-
else => .nonstandard,
234+
else => .server_error,
237235
};
238236
}
239237

0 commit comments

Comments
 (0)