Merge pull request #1250 from Mic92/fix-ssh-prefix

hydra: fix localhost detection when protocol prefix are used
This commit is contained in:
Janne Heß
2022-09-30 10:06:29 +02:00
committed by GitHub

View File

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