Skip to content

Commit

Permalink
fix a bug in plugin Redirector. (#2198)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanglong3bf authored Nov 16, 2024
1 parent 8541e67 commit 882c1d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/Redirector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ void Redirector::initAndStart(const Json::Value &config)
}
std::string protocol, host;
bool pathChanged{false};
for (auto &handler : thisPtr->pathRewriteHandlers_)
{
pathChanged |= handler(req);
}
for (auto &handler : thisPtr->handlers_)
{
if (!handler(req, protocol, host, pathChanged))
{
return HttpResponse::newNotFoundResponse(req);
}
}
for (auto &handler : thisPtr->pathRewriteHandlers_)
{
pathChanged |= handler(req);
}
if (!protocol.empty() || !host.empty() || pathChanged)
{
std::string url;
Expand Down

0 comments on commit 882c1d9

Please sign in to comment.