mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd::http: Add a few more protocol codes.
This commit is contained in:
parent
f2ac156e6a
commit
bac30f93d1
2 changed files with 42 additions and 10 deletions
|
@ -30,13 +30,29 @@ namespace http {
|
|||
|
||||
enum code
|
||||
{
|
||||
OK = 200,
|
||||
CONTINUE = 100,
|
||||
SWITCHING_PROTOCOLS = 101,
|
||||
|
||||
BAD_REQUEST = 400,
|
||||
NOT_FOUND = 404,
|
||||
METHOD_NOT_ALLOWED = 405,
|
||||
OK = 200,
|
||||
CREATED = 201,
|
||||
ACCEPTED = 202,
|
||||
NON_AUTHORITATIVE_INFORMATION = 203,
|
||||
NO_CONTENT = 204,
|
||||
|
||||
INTERNAL_SERVER_ERROR = 500,
|
||||
BAD_REQUEST = 400,
|
||||
UNAUTHORIZED = 401,
|
||||
FORBIDDEN = 403,
|
||||
NOT_FOUND = 404,
|
||||
METHOD_NOT_ALLOWED = 405,
|
||||
REQUEST_TIMEOUT = 408,
|
||||
EXPECTATION_FAILED = 417,
|
||||
TOO_MANY_REQUESTS = 429,
|
||||
REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
|
||||
|
||||
INTERNAL_SERVER_ERROR = 500,
|
||||
NOT_IMPLEMENTED = 501,
|
||||
SERVICE_UNAVAILABLE = 503,
|
||||
HTTP_VERSION_NOT_SUPPORTED = 505,
|
||||
};
|
||||
|
||||
extern std::map<code, std::string> reason;
|
||||
|
|
26
ircd/http.cc
26
ircd/http.cc
|
@ -384,13 +384,29 @@ namespace http {
|
|||
|
||||
std::map<code, std::string> reason
|
||||
{
|
||||
{ code::OK, "OK"s },
|
||||
{ code::CONTINUE, "Continue"s },
|
||||
{ code::SWITCHING_PROTOCOLS, "Switching Protocols"s },
|
||||
|
||||
{ code::BAD_REQUEST, "Bad Request"s },
|
||||
{ code::NOT_FOUND, "Not Found"s },
|
||||
{ code::METHOD_NOT_ALLOWED, "Method Not Allowed"s },
|
||||
{ code::OK, "OK"s },
|
||||
{ code::CREATED, "Created"s },
|
||||
{ code::ACCEPTED, "Accepted"s },
|
||||
{ code::NON_AUTHORITATIVE_INFORMATION, "Non-Authoritative Information"s },
|
||||
{ code::NO_CONTENT, "No Content"s },
|
||||
|
||||
{ code::INTERNAL_SERVER_ERROR, "Internal Server Error"s },
|
||||
{ code::BAD_REQUEST, "Bad Request"s },
|
||||
{ code::UNAUTHORIZED, "Unauthorized"s },
|
||||
{ code::FORBIDDEN, "Forbidden"s },
|
||||
{ code::NOT_FOUND, "Not Found"s },
|
||||
{ code::METHOD_NOT_ALLOWED, "Method Not Allowed"s },
|
||||
{ code::REQUEST_TIMEOUT, "Request Time-out"s },
|
||||
{ code::EXPECTATION_FAILED, "Expectation Failed"s },
|
||||
{ code::TOO_MANY_REQUESTS, "Too Many Requests"s },
|
||||
{ code::REQUEST_HEADER_FIELDS_TOO_LARGE, "Request Header Fields Too Large"s },
|
||||
|
||||
{ code::INTERNAL_SERVER_ERROR, "Internal Server Error"s },
|
||||
{ code::NOT_IMPLEMENTED, "Not Implemented"s },
|
||||
{ code::SERVICE_UNAVAILABLE, "Service Unavailable"s },
|
||||
{ code::HTTP_VERSION_NOT_SUPPORTED, "HTTP Version Not Supported"s },
|
||||
};
|
||||
|
||||
} // namespace http
|
||||
|
|
Loading…
Reference in a new issue