forked from lix-project/hydra
hydra: fix localhost detection when protocol prefix are used
This commit is contained in:
parent
a8876a8956
commit
94d19e1972
|
@ -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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue