mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Split handle_request_main into handle_request_main and _handle_request_main. _handle_request_main should be responsible for actually rendering a page, while the normal one is responsible for routing by default. This makes the design simpler.
This commit is contained in:
parent
0c6c20bd64
commit
f498628ee1
@ -70,6 +70,11 @@ void WebNode::set_database(Database *db) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void WebNode::handle_request_main(Request *request) {
|
void WebNode::handle_request_main(Request *request) {
|
||||||
|
_handle_request_main(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WebNode::_handle_request_main(Request *request) {
|
||||||
|
request->send_error(HTTP_STATUS_CODE_404_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebNode::handle_error_send_request(Request *request, const int error_code) {
|
void WebNode::handle_error_send_request(Request *request, const int error_code) {
|
||||||
|
@ -33,6 +33,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
virtual void handle_request_main(Request *request);
|
virtual void handle_request_main(Request *request);
|
||||||
|
virtual void _handle_request_main(Request *request);
|
||||||
virtual void handle_error_send_request(Request *request, const int error_code);
|
virtual void handle_error_send_request(Request *request, const int error_code);
|
||||||
|
|
||||||
virtual void create_validators();
|
virtual void create_validators();
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
void WebRouterNode::handle_request_main(Request *request) {
|
void WebRouterNode::handle_request_main(Request *request) {
|
||||||
if (!try_route_request_to_children(request)) {
|
if (!try_route_request_to_children(request)) {
|
||||||
request->send_error(404);
|
_handle_request_main(request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user