hydra: fix localhost detection when protocol prefix are used

This commit is contained in:
Jörg Thalheim 2022-09-29 20:42:57 +02:00
parent a8876a8956
commit 94d19e1972

View file

@ -6,6 +6,7 @@
#include <map>
#include <memory>
#include <queue>
#include <regex>
#include <prometheus/counter.h>
#include <prometheus/gauge.h>
@ -293,7 +294,8 @@ struct Machine
bool isLocalhost()
{
return sshName == "localhost";
std::regex r("^(ssh://|ssh-ng://)?localhost$");
return std::regex_search(sshName, r);
}
};