redirect to main page instead 40x error
parent
fa4c527298
commit
12d7943519
|
@ -21,14 +21,8 @@ void HttpServer::setup()
|
||||||
{
|
{
|
||||||
CROW_CATCHALL_ROUTE(app_)
|
CROW_CATCHALL_ROUTE(app_)
|
||||||
([](crow::response& res) {
|
([](crow::response& res) {
|
||||||
if (res.code == 404)
|
res.code = 303;
|
||||||
{
|
res.set_header("Location", "/");
|
||||||
res.body = "The URL does not seem to be correct.";
|
|
||||||
}
|
|
||||||
else if (res.code == 405)
|
|
||||||
{
|
|
||||||
res.body = "The HTTP method does not seem to be correct.";
|
|
||||||
}
|
|
||||||
res.end();
|
res.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue