| 499 | static bool isCookieIpHost(SC::StringSpan host) |
| 500 | { |
| 501 | const SC::Span<const char> bytes = host.toCharSpan(); |
| 502 | if (bytes.sizeInBytes() >= 2 and bytes[0] == '[' and bytes[bytes.sizeInBytes() - 1] == ']') |
| 503 | { |
| 504 | return true; |
| 505 | } |
| 506 | |
| 507 | bool hasDot = false; |
| 508 | for (size_t idx = 0; idx < bytes.sizeInBytes(); ++idx) |
| 509 | { |
| 510 | if (bytes[idx] == '.') |
| 511 | { |
| 512 | hasDot = true; |
| 513 | } |
| 514 | else if (bytes[idx] < '0' or bytes[idx] > '9') |
| 515 | { |
| 516 | return false; |
| 517 | } |
| 518 | } |
| 519 | return hasDot; |
| 520 | } |
no test coverage detected