forked from lix-project/hydra
Merge pull request #1250 from Mic92/fix-ssh-prefix
hydra: fix localhost detection when protocol prefix are used
This commit is contained in:
commit
7e459e8c5a
|
@ -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