Permalink
Browse files

add RFC 6585 http status codes

  • Loading branch information...
1 parent 50ee2f6 commit b35d5dd67b1fe9b6a63bc9ec6bace1eb813bf618 @ccutrer committed Mar 19, 2013
Showing with 17 additions and 1 deletion.
  1. +10 −0 mordor/http/http.cpp
  2. +7 −1 mordor/http/http.h
View
@@ -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";
@@ -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>";
View
@@ -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);

0 comments on commit b35d5dd

Please sign in to comment.