Skip to content

Commit

Permalink
Improve HTTP status codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbockelm committed Dec 19, 2018
1 parent f135f5d commit 1fd600c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/XrdMacaroons/XrdMacaroonsHandler.cc
Expand Up @@ -160,7 +160,7 @@ Handler::MatchesPath(const char *verb, const char *path)
int Handler::ProcessOAuthConfig(XrdHttpExtReq &req) {
if (req.verb != "GET")
{
return req.SendSimpleResp(400, NULL, NULL, "Only GET is valid for oauth config.", 0);
return req.SendSimpleResp(405, NULL, NULL, "Only GET is valid for oauth config.", 0);
}
auto header = req.headers.find("Host");
if (header == req.headers.end())
Expand Down Expand Up @@ -193,7 +193,7 @@ int Handler::ProcessTokenRequest(XrdHttpExtReq &req)
{
if (req.verb != "POST")
{
return req.SendSimpleResp(400, NULL, NULL, "Only POST is valid for token request.", 0);
return req.SendSimpleResp(405, NULL, NULL, "Only POST is valid for token request.", 0);
}
auto header = req.headers.find("Content-Type");
if (header == req.headers.end())
Expand Down

0 comments on commit 1fd600c

Please sign in to comment.