aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/httpclient.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-10-02 16:19:40 +0200
committerGitHub Enterprise <[email protected]>2025-10-02 16:19:40 +0200
commit7838d47561dbc2dd42ec3f6b851efb710fec1842 (patch)
treec27673e751c745f95045e794b653d8c9d0d23923 /src/zenhttp/httpclient.cpp
parentadd zenremotestore lib (#540) (diff)
downloadzen-7838d47561dbc2dd42ec3f6b851efb710fec1842.tar.xz
zen-7838d47561dbc2dd42ec3f6b851efb710fec1842.zip
fix for RPC replay issue (wrong content-type) (#536)
likely fall-out from HttpClient refactor. The content type used to be explicit via headers but is now taken from the `IoBuffer` also fixed issue which meant the original request session ID would also not be propagated as intended
Diffstat (limited to 'src/zenhttp/httpclient.cpp')
-rw-r--r--src/zenhttp/httpclient.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/zenhttp/httpclient.cpp b/src/zenhttp/httpclient.cpp
index 3da9f91fc..c5c808c23 100644
--- a/src/zenhttp/httpclient.cpp
+++ b/src/zenhttp/httpclient.cpp
@@ -39,7 +39,14 @@ HttpClientBase::HttpClientBase(std::string_view BaseUri, const HttpClientSetting
, m_BaseUri(BaseUri)
, m_ConnectionSettings(ConnectionSettings)
{
- m_SessionId = GetSessionIdString();
+ if (ConnectionSettings.SessionId == Oid::Zero)
+ {
+ m_SessionId = GetSessionIdString();
+ }
+ else
+ {
+ m_SessionId = ConnectionSettings.SessionId.ToString();
+ }
}
HttpClientBase::~HttpClientBase()
@@ -207,6 +214,19 @@ HttpClient::~HttpClient()
delete m_Inner;
}
+void
+HttpClient::SetSessionId(const Oid& SessionId)
+{
+ if (SessionId == Oid::Zero)
+ {
+ m_SessionId = GetSessionIdString();
+ }
+ else
+ {
+ m_SessionId = SessionId.ToString();
+ }
+}
+
HttpClient::Response
HttpClient::Put(std::string_view Url, const IoBuffer& Payload, const HttpClient::KeyValueMap& AdditionalHeader)
{