Skip to content

Commit 9a2d672

Browse files
authored
Fix: initialize middlewares for regex WebSocket routes in wsCtrlVector_ (#2464)
1 parent a8c5823 commit 9a2d672

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/src/HttpControllersRouter.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ void HttpControllersRouter::init(
6363
initMiddlewaresAndCorsMethods(iter.second);
6464
}
6565

66+
for (auto &router : wsCtrlVector_)
67+
{
68+
initMiddlewaresAndCorsMethods(router);
69+
}
70+
6671
for (auto &router : ctrlVector_)
6772
{
6873
router.regex_ = std::regex(router.pathParameterPattern_,
@@ -85,6 +90,7 @@ void HttpControllersRouter::reset()
8590
ctrlMap_.clear();
8691
ctrlVector_.clear();
8792
wsCtrlMap_.clear();
93+
wsCtrlVector_.clear();
8894
}
8995

9096
std::vector<HttpHandlerInfo> HttpControllersRouter::getHandlersInfo() const

0 commit comments

Comments
 (0)