From f4d1ac0a309fb6fe0c9ca02b8d116c2075638b54 Mon Sep 17 00:00:00 2001 From: renerocksai Date: Thu, 28 Aug 2025 20:21:23 +0200 Subject: [PATCH] fix #178 status code mismatch --- src/http.zig | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/http.zig b/src/http.zig index f07ad2b..cdb17d2 100644 --- a/src/http.zig +++ b/src/http.zig @@ -47,7 +47,7 @@ pub const StatusCode = enum(u16) { gone = 410, length_required = 411, precondition_failed = 412, - payload_too_large = 413, + content_too_large = 413, uri_too_long = 414, unsupported_media_type = 415, range_not_satisfiable = 416, @@ -91,7 +91,7 @@ pub const StatusCode = enum(u16) { .no_content => "No Content", .reset_content => "Reset Content", .partial_content => "Partial Content", - .multiple_choices => "Multiple Choices", + .multi_status => "Multi-Status", .moved_permanently => "Moved Permanently", .found => "Found", .see_other => "See Other", @@ -111,11 +111,10 @@ pub const StatusCode = enum(u16) { .gone => "Gone", .length_required => "Length Required", .precondition_failed => "Precondition Failed", - .request_entity_too_large => "Request Entity Too Large", - .request_uri_too_long => "Request-URI Too Long", - .unsupported_mediatype => "Unsupported Media Type", - .requested_range_not_satisfiable => "Requested Range Not Satisfiable", - .teapot => "I'm a Teapot", + .content_too_large => "Content Too Large", + .uri_too_long => "URI Too Long", + .unsupported_media_type => "Unsupported Media Type", + .range_not_satisfiable => "Range Not Satisfiable", .upgrade_required => "Upgrade Required", .request_header_fields_too_large => "Request Header Fields Too Large", .expectation_failed => "Expectation Failed", @@ -125,7 +124,29 @@ pub const StatusCode = enum(u16) { .service_unavailable => "Service Unavailable", .gateway_timeout => "Gateway Timeout", .http_version_not_supported => "HTTP Version Not Supported", - _ => "", + + .early_hints => "Early Hints", + .already_reported => "Already Reported", + .im_used => "IM Used", + .unused => "306", // unused + .permanent_redirect => "Permanent Redirect", + .im_a_teapot => "I'm a teapot", + .misdirected_request => "Misdirected Request", + .unprocessable_content => "Unprocessable Content", // (WebDAV) + .locked => "Locked", // (WebDAV) + .failed_dependency => "Failed Dependency", // (WebDAV) + .too_early => "Too Early", + .precondition_required => "Precondition Required", + .too_many_requests => "Too Many Requests", + .unavailable_for_legal_reasons => "Unavailable For Legal Reasons", // gotta love those lawyers + .variant_also_negotiates => "Variant Also Negotiates", + .insufficient_storage => "Insufficient Storage", // (WebDAV) + .loop_detected => "Loop Detected", // (WebDAV) + .not_extended => "Not Extended", + .network_authentication_required => "Network Authentication Required", + .processing => "Processing", + .multiple_choices => "Multiple Chouces", + _ => "(Unknown)", }; } };