| 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 | } |