| 481 | } |
| 482 | |
| 483 | static SC::StringSpan defaultCookiePath(SC::StringSpan requestPath) |
| 484 | { |
| 485 | const SC::Span<const char> bytes = requestPath.toCharSpan(); |
| 486 | if (bytes.sizeInBytes() == 0 or bytes[0] != '/') |
| 487 | { |
| 488 | return SC::StringSpan("/"); |
| 489 | } |
| 490 | |
| 491 | for (size_t idx = bytes.sizeInBytes(); idx > 0; --idx) |
| 492 | { |
| 493 | if (bytes[idx - 1] == '/') |
| 494 | { |
| 495 | return idx == 1 ? SC::StringSpan("/") : sliceString(requestPath, 0, idx - 1); |
| 496 | } |
| 497 | } |
| 498 | return SC::StringSpan("/"); |
| 499 | } |
| 500 | |
| 501 | static bool cookiePathMatches(const SC::HttpClientSessionCookie& cookie, SC::StringSpan path) |
| 502 | { |
no test coverage detected