summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-07-27 02:47:23 +0300
committerEd Tanous <ed@tanous.net>2022-09-01 02:01:04 +0300
commit44e4518b700bd97cdca09d05e3c24712a4799788 (patch)
tree9959e9d739a2bb6ce3cddddf83d22f27af1affc2 /src
parent1e75e1dde032e327f16cf7270b0de621f0c6ccc6 (diff)
downloadbmcweb-44e4518b700bd97cdca09d05e3c24712a4799788.tar.xz
Allow custom 404 handlers
Different HTTP protocols have different http responses for 404. This commit adds support for registering a route designed to host a handler meant for when a response would otherwise return. This allows registering a custom 404 handler for Redfish, for which all routes will now return a Redfish response. This was in response to the 404 handler not working in all cases (in the case of POST/PATCH/DELETE). Allowing an explicit registration helps to give the intended behavior in all cases. Tested: GET /redfish/v1/foo returns 404 Not found PATCH /redfish/v1/foo returns 404 Not found GET /redfish/v1 returns 200 OK, and content PATCH /redfish/v1 returns 405 Method Not Allowed With Redfish Aggregation: GET /redfish/v1/foo gets forwarded to satellite BMC PATCH /redfish/v1/foo does not get forwarded and returns 404 PATCH /redfish/v1/foo/5B247A_bar gets forwarded Unit tests pass Redfish-service-validator passes Redfish-Protocol-Validator fails 7 tests (same as before) Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I731a5b4e736a2480700d8f3e81f9c9c6cbe6efca Signed-off-by: Carson Labrado <clabrado@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/crow_getroutes_test.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/crow_getroutes_test.cpp b/src/crow_getroutes_test.cpp
index 58b745b430..23a511e735 100644
--- a/src/crow_getroutes_test.cpp
+++ b/src/crow_getroutes_test.cpp
@@ -68,4 +68,4 @@ TEST(GetRoutes, TestlotsOfRoutes)
Pointee(Eq("/moo"))));
}
} // namespace
-} // namespace crow \ No newline at end of file
+} // namespace crow