MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / defaultCookiePath

Function defaultCookiePath

Libraries/HttpClient/HttpClientSession.cpp:483–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481 parsed.host = sliceString(url, hostnameStart, hostnameEnd);
482
483 if (hostEnd < bytes.sizeInBytes() and bytes[hostEnd] == '/')
484 {
485 size_t pathEnd = hostEnd;
486 while (pathEnd < bytes.sizeInBytes() and bytes[pathEnd] != '?' and bytes[pathEnd] != '#')
487 {
488 pathEnd += 1;
489 }
490 parsed.path = sliceString(url, hostEnd, pathEnd);
491 }
492 else
493 {
494 parsed.path = SC::StringSpan("/");
495 }
496 return true;
497}
498
499static 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] == ']')

Callers 1

captureSetCookieMethod · 0.85

Calls 3

StringSpanFunction · 0.85
sliceStringFunction · 0.85
sizeInBytesMethod · 0.45

Tested by

no test coverage detected