Skip to content

Commit 171fc2e

Browse files
committed
Fix #403. Added more status codes based on MDN document
1 parent ced4160 commit 171fc2e

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

httplib.h

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,25 +1598,67 @@ find_content_type(const std::string &path,
15981598
inline const char *status_message(int status) {
15991599
switch (status) {
16001600
case 100: return "Continue";
1601+
case 101: return "Switching Protocol";
1602+
case 102: return "Processing";
1603+
case 103: return "Early Hints";
16011604
case 200: return "OK";
16021605
case 201: return "Created";
16031606
case 202: return "Accepted";
1607+
case 203: return "Non-Authoritative Information";
16041608
case 204: return "No Content";
1609+
case 205: return "Reset Content";
16051610
case 206: return "Partial Content";
1611+
case 207: return "Multi-Status";
1612+
case 208: return "Already Reported";
1613+
case 226: return "IM Used";
1614+
case 300: return "Multiple Choice";
16061615
case 301: return "Moved Permanently";
16071616
case 302: return "Found";
16081617
case 303: return "See Other";
16091618
case 304: return "Not Modified";
1619+
case 305: return "Use Proxy";
1620+
case 306: return "unused";
1621+
case 307: return "Temporary Redirect";
1622+
case 308: return "Permanent Redirect";
16101623
case 400: return "Bad Request";
16111624
case 401: return "Unauthorized";
1625+
case 402: return "Payment Required";
16121626
case 403: return "Forbidden";
16131627
case 404: return "Not Found";
1628+
case 405: return "Method Not Allowed";
1629+
case 406: return "Not Acceptable";
1630+
case 407: return "Proxy Authentication Required";
1631+
case 408: return "Request Timeout";
1632+
case 409: return "Conflict";
1633+
case 410: return "Gone";
1634+
case 411: return "Length Required";
1635+
case 412: return "Precondition Failed";
16141636
case 413: return "Payload Too Large";
1615-
case 414: return "Request-URI Too Long";
1637+
case 414: return "URI Too Long";
16161638
case 415: return "Unsupported Media Type";
16171639
case 416: return "Range Not Satisfiable";
16181640
case 417: return "Expectation Failed";
1641+
case 418: return "I'm a teapot";
1642+
case 421: return "Misdirected Request";
1643+
case 422: return "Unprocessable Entity";
1644+
case 423: return "Locked";
1645+
case 424: return "Failed Dependency";
1646+
case 425: return "Too Early";
1647+
case 426: return "Upgrade Required";
1648+
case 428: return "Precondition Required";
1649+
case 429: return "Too Many Requests";
1650+
case 431: return "Request Header Fields Too Large";
1651+
case 451: return "Unavailable For Legal Reasons";
1652+
case 501: return "Not Implemented";
1653+
case 502: return "Bad Gateway";
16191654
case 503: return "Service Unavailable";
1655+
case 504: return "Gateway Timeout";
1656+
case 505: return "HTTP Version Not Supported";
1657+
case 506: return "Variant Also Negotiates";
1658+
case 507: return "Insufficient Storage";
1659+
case 508: return "Loop Detected";
1660+
case 510: return "Not Extended";
1661+
case 511: return "Network Authentication Required";
16201662

16211663
default:
16221664
case 500: return "Internal Server Error";

0 commit comments

Comments
 (0)