Skip to content

Commit fe3003d

Browse files
committed
Update status code reason phrases
As per RFC2616
1 parent daf360d commit fe3003d

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

libraries/ESP8266WebServer/src/ESP8266WebServer.cpp

+37-2
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,46 @@ void ESP8266WebServer::_handleRequest() {
372372

373373
const char* ESP8266WebServer::_responseCodeToString(int code) {
374374
switch (code) {
375+
case 100: return "Continue";
375376
case 101: return "Switching Protocols";
376377
case 200: return "OK";
378+
case 201: return "Created";
379+
case 202: return "Accepted";
380+
case 203: return "Non-Authoritative Information";
381+
case 204: return "No Content";
382+
case 205: return "Reset Content";
383+
case 206: return "Partial Content";
384+
case 300: return "Multiple Choices";
385+
case 301: return "Moved Permanently";
386+
case 302: return "Found";
387+
case 303: return "See Other";
388+
case 304: return "Not Modified";
389+
case 305: return "Use Proxy";
390+
case 307: return "Temporary Redirect";
391+
case 400: return "Bad Request";
392+
case 401: return "Unauthorized";
393+
case 402: return "Payment Required";
377394
case 403: return "Forbidden";
378-
case 404: return "Not found";
379-
case 500: return "Fail";
395+
case 404: return "Not Found";
396+
case 405: return "Method Not Allowed";
397+
case 406: return "Not Acceptable";
398+
case 407: return "Proxy Authentication Required";
399+
case 408: return "Request Time-out";
400+
case 409: return "Conflict";
401+
case 410: return "Gone";
402+
case 411: return "Length Required";
403+
case 412: return "Precondition Failed";
404+
case 413: return "Request Entity Too Large";
405+
case 414: return "Request-URI Too Large";
406+
case 415: return "Unsupported Media Type";
407+
case 416: return "Requested range not satisfiable";
408+
case 417: return "Expectation Failed";
409+
case 500: return "Internal Server Error";
410+
case 501: return "Not Implemented";
411+
case 502: return "Bad Gateway";
412+
case 503: return "Service Unavailable";
413+
case 504: return "Gateway Time-out";
414+
case 505: return "HTTP Version not supported";
380415
default: return "";
381416
}
382417
}

0 commit comments

Comments
 (0)