MCPcopy Create free account
hub / github.com/catboost/catboost / IsFQDN

Function IsFQDN

util/system/hostname.cpp:102–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102bool IsFQDN(const TString& name) {
103 TString absName = name;
104 if (!absName.EndsWith('.')) {
105 absName.append(".");
106 }
107
108 try {
109 // ResolveHost() can't be used since it is ipv4-only, port is not important
110 TNetworkAddress addr(absName, 0);
111 } catch (const TNetworkResolutionError&) {
112 return false;
113 }
114 return true;
115}

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 2

EndsWithMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected