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

Method captureResponse

Libraries/HttpClient/HttpClientSession.cpp:1016–1027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1014 {
1015 SC_TRY(appendMatchingCookies(source.url, numHeaders));
1016 }
1017
1018 if (not sessionRequestHasHeader(source, StringSpan("Authorization")))
1019 {
1020 ParsedUrl parsed;
1021 if (not parseUrl(source.url, parsed))
1022 return Result::Error(HttpClientResultCategory, HttpClientError::SessionRequestUrlInvalid);
1023 for (size_t idx = 0; idx < sessionMemory.authEntries.sizeInElements(); ++idx)
1024 {
1025 const HttpClientSessionAuthCacheEntry& entry = sessionMemory.authEntries[idx];
1026 if (entry.isInUse() and sessionAsciiEqualsIgnoreCase(entry.origin, parsed.origin))
1027 {
1028 SC_TRY(appendPreparedHeader(StringSpan("Authorization"), entry.authorizationHeader, numHeaders));
1029 break;
1030 }

Callers 2

sessionLayerMethod · 0.80
saneMainFunction · 0.80

Calls 3

StringSpanFunction · 0.85
findNextHeaderMethod · 0.80
ResultClass · 0.50

Tested by 1

sessionLayerMethod · 0.64