Skip to content

Commit

Permalink
add RFC 6585 http status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ccutrer committed Mar 19, 2013
1 parent 50ee2f6 commit b35d5dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 10 additions & 0 deletions mordor/http/http.cpp
Expand Up @@ -254,6 +254,13 @@ const char *reason(Status s)
return "Requested range not satisfiable";
case EXPECTATION_FAILED:
return "Expectation Failed";
// RFC 6585
case PRECONDITION_REQUIRED:
return "Precondition Required";
case TOO_MANY_REQUESTS:
return "Too Many Requests";
case REQUEST_HEADER_FIELDS_TOO_LARGE:
return "Request Header Fields Too Large";

case INTERNAL_SERVER_ERROR:
return "Internal Server Error";
Expand All @@ -267,6 +274,9 @@ const char *reason(Status s)
return "Gateway Time-out";
case HTTP_VERSION_NOT_SUPPORTED:
return "HTTP Version not supported";
// RFC 6585
case NETWORK_AUTHENTICATION_REQUIRED:
return "Network Authentication Required";

default:
return "<INVALID>";
Expand Down
8 changes: 7 additions & 1 deletion mordor/http/http.h
Expand Up @@ -100,13 +100,19 @@ enum Status
UNSUPPORTED_MEDIA_TYPE = 415,
REQUESTED_RANGE_NOT_SATISFIABLE = 416,
EXPECTATION_FAILED = 417,
// RFC 6585
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,
GATEWAY_TIMEOUT = 504,
HTTP_VERSION_NOT_SUPPORTED = 505
HTTP_VERSION_NOT_SUPPORTED = 505,
// RFC 6585
NETWORK_AUTHENTICATION_REQUIRED = 511
};
const char *reason(Status s);

Expand Down

0 comments on commit b35d5dd

Please sign in to comment.