| 317 | } |
| 318 | |
| 319 | TStringBuf GetParentDomain(const TStringBuf host Y_LIFETIME_BOUND, size_t level) noexcept { |
| 320 | size_t pos = host.size(); |
| 321 | for (size_t i = 0; i < level; ++i) { |
| 322 | pos = host.rfind('.', pos); |
| 323 | if (pos == TString::npos) |
| 324 | return host; |
| 325 | } |
| 326 | return host.SubStr(pos + 1); |
| 327 | } |
| 328 | |
| 329 | TStringBuf GetZone(const TStringBuf host Y_LIFETIME_BOUND) noexcept { |
| 330 | return GetParentDomain(host, 1); |
no test coverage detected