Skip to content

Commit 882c1d9

Browse files
authored
fix a bug in plugin Redirector. (#2198)
1 parent 8541e67 commit 882c1d9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/src/Redirector.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ void Redirector::initAndStart(const Json::Value &config)
3030
}
3131
std::string protocol, host;
3232
bool pathChanged{false};
33+
for (auto &handler : thisPtr->pathRewriteHandlers_)
34+
{
35+
pathChanged |= handler(req);
36+
}
3337
for (auto &handler : thisPtr->handlers_)
3438
{
3539
if (!handler(req, protocol, host, pathChanged))
3640
{
3741
return HttpResponse::newNotFoundResponse(req);
3842
}
3943
}
40-
for (auto &handler : thisPtr->pathRewriteHandlers_)
41-
{
42-
pathChanged |= handler(req);
43-
}
4444
if (!protocol.empty() || !host.empty() || pathChanged)
4545
{
4646
std::string url;

0 commit comments

Comments
 (0)