diff options
| author | Dan Engelbrecht <[email protected]> | 2026-03-18 14:29:06 +0100 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2026-03-20 15:49:46 +0100 |
| commit | 196920d53d2de43a5d6e01d07a34b8e1dc7970d6 (patch) | |
| tree | b08dbad197566a876381980cc960fb091b06795e /src/zenhttp/clients/httpclientcpr.cpp | |
| parent | version -> 5.7.23 (diff) | |
| download | zen-196920d53d2de43a5d6e01d07a34b8e1dc7970d6.tar.xz zen-196920d53d2de43a5d6e01d07a34b8e1dc7970d6.zip | |
rework HttpClientAccessToken expiration check
don't do unattended oidctoken refresh unless explicitly requested to
don't hide oidctoken fetching in httpprojectstore
the authtoken callback are not thread safe, caller must ensure single thread call
add retry if getting an oidctoken fails
handle HttpResponseCode::NotImplemented when requesting multirange from jupiter
Diffstat (limited to 'src/zenhttp/clients/httpclientcpr.cpp')
| -rw-r--r-- | src/zenhttp/clients/httpclientcpr.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/zenhttp/clients/httpclientcpr.cpp b/src/zenhttp/clients/httpclientcpr.cpp index a0f5cc38f..98a3ce612 100644 --- a/src/zenhttp/clients/httpclientcpr.cpp +++ b/src/zenhttp/clients/httpclientcpr.cpp @@ -398,13 +398,13 @@ CprHttpClient::DoWithRetry(std::string_view SessionId, ////////////////////////////////////////////////////////////////////////// CprHttpClient::Session -CprHttpClient::AllocSession(const std::string_view BaseUrl, - const std::string_view ResourcePath, - const HttpClientSettings& ConnectionSettings, - const KeyValueMap& AdditionalHeader, - const KeyValueMap& Parameters, - const std::string_view SessionId, - std::optional<HttpClientAccessToken> AccessToken) +CprHttpClient::AllocSession(const std::string_view BaseUrl, + const std::string_view ResourcePath, + const HttpClientSettings& ConnectionSettings, + const KeyValueMap& AdditionalHeader, + const KeyValueMap& Parameters, + const std::string_view SessionId, + std::optional<std::string> AccessToken) { ZEN_TRACE_CPU("CprHttpClient::AllocSession"); cpr::Session* CprSession = nullptr; @@ -493,9 +493,10 @@ CprHttpClient::AllocSession(const std::string_view BaseUrl, { CprSession->UpdateHeader({{"Connection", "close"}}); } - if (AccessToken) + + if (AccessToken.has_value()) { - CprSession->UpdateHeader({{"Authorization", AccessToken->Value}}); + CprSession->UpdateHeader({{"Authorization", AccessToken.value()}}); } if (!Parameters->empty()) { |