]> git.tdb.fi Git - libs/net.git/commitdiff
Add 405 (method not allowed) status
authorMikko Rasa <tdb@tdb.fi>
Thu, 22 Jan 2015 14:16:14 +0000 (16:16 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 22 Jan 2015 14:16:14 +0000 (16:16 +0200)
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.

source/http/status.cpp
source/http/status.h

index 6b95822ac0bac01c52091f58df923f91e9ba9a87..c5fdf96a854c1a40475b317ba095a52773362af1 100644 (file)
@@ -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;
index 075016dd48aee2c6acc17fc345a48746d6bb306a..fe18a85f3251384e18518788df62b7f5413f450e 100644 (file)
@@ -13,6 +13,7 @@ enum Status
        BAD_REQUEST = 400,
        FORBIDDEN = 403,
        NOT_FOUND = 404,
+       METHOD_NOT_ALLOWED = 405,
        INTERNAL_ERROR = 500,
        NOT_IMPLEMENTED = 501
 };