72 {
73 LOG(TRACE) <<
"======================= APPLICATION DISPATCH =======================";
74 LOG(TRACE) << controller.
getResponse()->getSocketContext()->getSocketConnection()->getConnectionName();
75 LOG(TRACE) <<
" Request Method: " << controller.
getRequest()->method;
76 LOG(TRACE) <<
" Request Url: " << controller.
getRequest()->url;
77 LOG(TRACE) <<
" Request Path: " << controller.
getRequest()->path;
78 LOG(TRACE) <<
" Mountpoint Method: " << mountPoint.
method;
80 LOG(TRACE) <<
" StrictRouting: " << strictRouting;
81 LOG(TRACE) <<
" CaseInsensitiveRouting: " << caseInsensitiveRouting;
82 LOG(TRACE) <<
" MergeParams: " << mergeParams;
83
84 bool dispatched = false;
85
87
89 const MountMatchResult
match =
91
92 if (
match.requestMatched) {
93 LOG(TRACE) <<
"----------------------- APPLICATION MATCH -----------------------";
94
95 dispatched = true;
96
97 if (!
match.decodeError) {
98 express::Request& request = *controller.
getRequest();
99 request.
queries.insert(
match.requestQueryPairs.begin(),
match.requestQueryPairs.end());
100
101
102 const ScopedPathStrip pathStrip(request,
match.isPrefix,
match.consumedLength);
103 const ScopedParams scopedParams(request,
match.params, mergeParams);
104
106 } else {
108 }
109
110 } else {
111 LOG(TRACE) <<
"----------------------- APPLICATION NOMATCH -----------------------";
112 }
113 } else {
114 LOG(TRACE) <<
"----------------------- APPLICATION NOMATCH -----------------------";
115 }
116
117 return dispatched;
118 }
const std::shared_ptr< Request > & getRequest() const
const std::shared_ptr< Response > & getResponse() const
std::map< std::string, std::string > queries
std::vector< std::string > names
bool match(const char *first, const char *second)
MountMatchResult matchMountPoint(express::Controller &controller, const std::string &absoluteMountPath, const express::MountPoint &mountPoint, std::regex &cachedRegex, std::vector< std::string > &cachedNames, bool strictRouting, bool caseInsensitiveRouting)
bool methodMatches(std::string_view requestMethod, const std::string &mountMethod)
std::string relativeMountPath