diff --git a/include/boost/http_proto/status.hpp b/include/boost/http_proto/status.hpp index 11c20c97..4695bfd9 100644 --- a/include/boost/http_proto/status.hpp +++ b/include/boost/http_proto/status.hpp @@ -38,8 +38,8 @@ enum class status : unsigned short code. */ switching_protocols = 101, - processing = 102, + early_hints = 103, ok = 200, created = 201, @@ -83,13 +83,12 @@ enum class status : unsigned short unprocessable_entity = 422, locked = 423, failed_dependency = 424, + too_early = 425, upgrade_required = 426, precondition_required = 428, too_many_requests = 429, request_header_fields_too_large = 431, - connection_closed_without_response = 444, unavailable_for_legal_reasons = 451, - client_closed_request = 499, internal_server_error = 500, not_implemented = 501, @@ -101,8 +100,7 @@ enum class status : unsigned short insufficient_storage = 507, loop_detected = 508, not_extended = 510, - network_authentication_required = 511, - network_connect_timeout_error = 599 + network_authentication_required = 511 }; /** Represents the class of a status-code. diff --git a/src/status.cpp b/src/status.cpp index 2137b4ec..cddde8c6 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -23,6 +23,7 @@ int_to_status(unsigned v) case status::continue_: case status::switching_protocols: case status::processing: + case status::early_hints: BOOST_FALLTHROUGH; // 2xx @@ -72,13 +73,12 @@ int_to_status(unsigned v) case status::unprocessable_entity: case status::locked: case status::failed_dependency: + case status::too_early: case status::upgrade_required: case status::precondition_required: case status::too_many_requests: case status::request_header_fields_too_large: - case status::connection_closed_without_response: case status::unavailable_for_legal_reasons: - case status::client_closed_request: BOOST_FALLTHROUGH; // 5xx @@ -93,7 +93,6 @@ int_to_status(unsigned v) case status::loop_detected: case status::not_extended: case status::network_authentication_required: - case status::network_connect_timeout_error: return static_cast(v); default: @@ -134,6 +133,7 @@ obsolete_reason( case status::continue_: return "Continue"; case status::switching_protocols: return "Switching Protocols"; case status::processing: return "Processing"; + case status::early_hints: return "Early Hints"; // 2xx case status::ok: return "OK"; @@ -180,13 +180,13 @@ obsolete_reason( case status::unprocessable_entity: return "Unprocessable Entity"; case status::locked: return "Locked"; case status::failed_dependency: return "Failed Dependency"; + case status::too_early: return "Too Early"; case status::upgrade_required: return "Upgrade Required"; case status::precondition_required: return "Precondition Required"; case status::too_many_requests: return "Too Many Requests"; case status::request_header_fields_too_large: return "Request Header Fields Too Large"; - case status::connection_closed_without_response: return "Connection Closed Without Response"; case status::unavailable_for_legal_reasons: return "Unavailable For Legal Reasons"; - case status::client_closed_request: return "Client Closed Request"; + // 5xx case status::internal_server_error: return "Internal Server Error"; case status::not_implemented: return "Not Implemented"; @@ -199,7 +199,6 @@ obsolete_reason( case status::loop_detected: return "Loop Detected"; case status::not_extended: return "Not Extended"; case status::network_authentication_required: return "Network Authentication Required"; - case status::network_connect_timeout_error: return "Network Connect Timeout Error"; default: break; diff --git a/test/unit/status.cpp b/test/unit/status.cpp index 5e408d80..a0f9e7d1 100644 --- a/test/unit/status.cpp +++ b/test/unit/status.cpp @@ -30,6 +30,7 @@ class status_test check(status::continue_ ,100, status_class::informational); check(status::switching_protocols ,101, status_class::informational); check(status::processing ,102, status_class::informational); + check(status::early_hints ,103, status_class::informational); check(status::ok ,200, status_class::successful); check(status::created ,201, status_class::successful); @@ -73,13 +74,12 @@ class status_test check(status::unprocessable_entity ,422, status_class::client_error); check(status::locked ,423, status_class::client_error); check(status::failed_dependency ,424, status_class::client_error); + check(status::too_early ,425, status_class::client_error); check(status::upgrade_required ,426, status_class::client_error); check(status::precondition_required ,428, status_class::client_error); check(status::too_many_requests ,429, status_class::client_error); check(status::request_header_fields_too_large ,431, status_class::client_error); - check(status::connection_closed_without_response ,444, status_class::client_error); check(status::unavailable_for_legal_reasons ,451, status_class::client_error); - check(status::client_closed_request ,499, status_class::client_error); check(status::internal_server_error ,500, status_class::server_error); check(status::not_implemented ,501, status_class::server_error); @@ -92,7 +92,6 @@ class status_test check(status::loop_detected ,508, status_class::server_error); check(status::not_extended ,510, status_class::server_error); check(status::network_authentication_required ,511, status_class::server_error); - check(status::network_connect_timeout_error ,599, status_class::server_error); BOOST_TEST(to_status_class(1) == status_class::unknown); BOOST_TEST(to_status_class(status::unknown) == status_class::unknown); @@ -105,6 +104,7 @@ class status_test good(status::continue_); good(status::switching_protocols); good(status::processing); + good(status::early_hints); good(status::ok); good(status::created); good(status::accepted); @@ -145,6 +145,7 @@ class status_test good(status::unprocessable_entity); good(status::locked); good(status::failed_dependency); + good(status::too_early); good(status::upgrade_required); good(status::precondition_required); good(status::too_many_requests);