diff options
| author | Stefan Boberg <[email protected]> | 2026-03-18 22:41:38 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-03-18 22:41:38 +0100 |
| commit | d48a83be4e75d5726cbd37274705b1c5ce7e625d (patch) | |
| tree | 208811d25ecabff8a8695544bc93ffd1d0a12fbf /src/zenhttp/clients/httpclientcpr.cpp | |
| parent | Remove IgnoreChildSignals() from zenserver main (diff) | |
| parent | improve auth token refresh (#863) (diff) | |
| download | zen-sb/pipes.tar.xz zen-sb/pipes.zip | |
Merge branch 'main' into sb/pipessb/pipes
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 a52b8f74b..bd6de3ff7 100644 --- a/src/zenhttp/clients/httpclientcpr.cpp +++ b/src/zenhttp/clients/httpclientcpr.cpp @@ -399,13 +399,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; @@ -494,9 +494,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()) { |