fix a bug in plugin Redirector. (#2198)
This commit is contained in:
parent
8541e67143
commit
882c1d9ecd
|
@ -30,6 +30,10 @@ 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))
|
||||
|
@ -37,10 +41,6 @@ void Redirector::initAndStart(const Json::Value &config)
|
|||
return HttpResponse::newNotFoundResponse(req);
|
||||
}
|
||||
}
|
||||
for (auto &handler : thisPtr->pathRewriteHandlers_)
|
||||
{
|
||||
pathChanged |= handler(req);
|
||||
}
|
||||
if (!protocol.empty() || !host.empty() || pathChanged)
|
||||
{
|
||||
std::string url;
|
||||
|
|
Loading…
Reference in New Issue