From: Mikko Rasa Date: Thu, 22 Jan 2015 14:16:14 +0000 (+0200) Subject: Add 405 (method not allowed) status X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=commitdiff_plain;h=d6450850c3f57b62819135f8975320427a618c78 Add 405 (method not allowed) status Since the HttpServer class allows either GET or POST and returns 501 (not implemented) for others, programs using it may wish to further limit processing to GET requests only. --- diff --git a/source/http/status.cpp b/source/http/status.cpp index 6b95822..c5fdf96 100644 --- a/source/http/status.cpp +++ b/source/http/status.cpp @@ -14,6 +14,7 @@ ostream &operator<<(ostream &out, Status status) case BAD_REQUEST: out<<"Bad Request"; break; case FORBIDDEN: out<<"Forbidden"; break; case NOT_FOUND: out<<"Not Found"; break; + case METHOD_NOT_ALLOWED: out<<"Method not allowed"; break; case INTERNAL_ERROR: out<<"Internal Error"; break; case NOT_IMPLEMENTED: out<<"Not Implemented"; break; default: out<<"Unknown Status"; break; diff --git a/source/http/status.h b/source/http/status.h index 075016d..fe18a85 100644 --- a/source/http/status.h +++ b/source/http/status.h @@ -13,6 +13,7 @@ enum Status BAD_REQUEST = 400, FORBIDDEN = 403, NOT_FOUND = 404, + METHOD_NOT_ALLOWED = 405, INTERNAL_ERROR = 500, NOT_IMPLEMENTED = 501 };