MCPcopy Create free account
hub / github.com/Icinga/icinga2 / ParseUserinfo

Method ParseUserinfo

lib/remote/url.cpp:260–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260bool Url::ParseUserinfo(const String& userinfo)
261{
262 size_t pos = userinfo.Find(":");
263 m_Username = userinfo.SubStr(0, pos);
264 if (!ValidateToken(m_Username, ACUSERINFO))
265 return false;
266 m_Username = Utility::UnescapeString(m_Username);
267 if (pos != String::NPos && pos != userinfo.GetLength() - 1) {
268 m_Password = userinfo.SubStr(pos+1);
269 if (!ValidateToken(m_Username, ACUSERINFO))
270 return false;
271 m_Password = Utility::UnescapeString(m_Password);
272 } else
273 m_Password = "";
274
275 return true;
276}
277
278bool Url::ParsePort(const String& port)
279{

Callers

nothing calls this directly

Calls 3

FindMethod · 0.80
SubStrMethod · 0.80
GetLengthMethod · 0.45

Tested by

no test coverage detected