From 403f65921e9d3425ddc62d027902c1631c4bff86 Mon Sep 17 00:00:00 2001 From: patlecat Date: Sun, 1 Dec 2013 13:41:34 +0100 Subject: [PATCH 1/2] Added all HTTP status codes Added all the missing HTTP v1.1 status codes and corrected the naming to the standard of some of the existing ones. --- boost/network/protocol/http/impl/response.ipp | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/boost/network/protocol/http/impl/response.ipp b/boost/network/protocol/http/impl/response.ipp index 0630bbde3..0c006f520 100644 --- a/boost/network/protocol/http/impl/response.ipp +++ b/boost/network/protocol/http/impl/response.ipp @@ -29,32 +29,59 @@ namespace boost { namespace network { namespace http { typedef tags::http_server tag; typedef response_header::type header_type; - /// The status of the reply. + /*! The status of the reply. Represent all the status codes of HTTP v1.1 + * from http://tools.ietf.org/html/rfc2616#page-39 and + * http://tools.ietf.org/html/rfc6585 + */ enum status_type { + continue_http = 100, + switching_protocols = 101, ok = 200, created = 201, accepted = 202, + non_authoritative_information = 203, no_content = 204, + reset_content = 205, partial_content = 206, multiple_choices = 300, moved_permanently = 301, - moved_temporarily = 302, + found = 302, + see_other = 303, not_modified = 304, + use_proxy = 305, + temporary_redirect = 307, bad_request = 400, unauthorized = 401, forbidden = 403, + payment_required = 402, + forbidden = 403, not_found = 404, - not_supported = 405, + method_not_allowed = 405, not_acceptable = 406, + proxy_authentication_required = 407, request_timeout = 408, + conflict = 409, + gone = 410, + length_required = 411, precondition_failed = 412, - unsatisfiable_range = 416, + request_entity_too_large = 413, + request_uri_too_large = 414, + unsupported_media_type = 415, + requested_range_not_satisfiable = 416, + expectation_failed = 417, + precondition_required = 428, + too_many_requests = 429, + request_header_fields_too_large = 431, internal_server_error = 500, not_implemented = 501, bad_gateway = 502, service_unavailable = 503, - space_unavailable = 507 + gateway_timeout = 504, + http_version_not_supported = 505, + space_unavailable = 507, + network_authentication_required = 511 } status; + /// The headers to be included in the reply. typedef vector::apply::type headers_vector; From afb1971d86a0d786d0b9602e1e9cc4193088909a Mon Sep 17 00:00:00 2001 From: patlecat Date: Sun, 1 Dec 2013 14:21:03 +0100 Subject: [PATCH 2/2] Backward compatability maintained I added the incorrectly named HTTP status code names back in but marked them as deprecated for the documentation. Now we have both names. --- boost/network/protocol/http/impl/response.ipp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boost/network/protocol/http/impl/response.ipp b/boost/network/protocol/http/impl/response.ipp index 0c006f520..25a968a6d 100644 --- a/boost/network/protocol/http/impl/response.ipp +++ b/boost/network/protocol/http/impl/response.ipp @@ -45,6 +45,7 @@ namespace boost { namespace network { namespace http { partial_content = 206, multiple_choices = 300, moved_permanently = 301, + moved_temporarily = 302, ///< \deprecated Not HTTP standard found = 302, see_other = 303, not_modified = 304, @@ -56,6 +57,7 @@ namespace boost { namespace network { namespace http { payment_required = 402, forbidden = 403, not_found = 404, + not_supported = 405, ///< \deprecated Not HTTP standard method_not_allowed = 405, not_acceptable = 406, proxy_authentication_required = 407, @@ -67,6 +69,7 @@ namespace boost { namespace network { namespace http { request_entity_too_large = 413, request_uri_too_large = 414, unsupported_media_type = 415, + unsatisfiable_range = 416, ///< \deprecated Not HTTP standard requested_range_not_satisfiable = 416, expectation_failed = 417, precondition_required = 428,