aboutsummaryrefslogtreecommitdiff
path: root/zenserver/upstream/zen.cpp
diff options
context:
space:
mode:
authormattpetersepic <[email protected]>2022-02-18 13:59:27 -0700
committerGitHub <[email protected]>2022-02-18 13:59:27 -0700
commitb0310f0da356fb9a5e9202f1352cad82e3811b10 (patch)
treea406be9d25ee35f8d1920e8fbc4f6d632ea4de96 /zenserver/upstream/zen.cpp
parentremote_build: allow path .zips are copied to to be overriden (diff)
downloadzen-b0310f0da356fb9a5e9202f1352cad82e3811b10.tar.xz
zen-b0310f0da356fb9a5e9202f1352cad82e3811b10.zip
Value propagation fix - Read/Write ValueAPI as CompressedBinary type when writing to zen and horde upstreams. Return failure from HandleGetCacheRecord if the requested type does not match the cachetype. (#55)
* Fix bug with getting values PUT to Jupiter as CompressedBinary. When getting CompressedBinary records from Jupiter, they are expected to now be a record with a reference to the compact binary. This has to be accounted for when performing upstream GETs. * HandleGetCacheRecord: avoid crashing on invalid type, and avoid sending back data that doesn't match the AcceptType.
Diffstat (limited to 'zenserver/upstream/zen.cpp')
-rw-r--r--zenserver/upstream/zen.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/zenserver/upstream/zen.cpp b/zenserver/upstream/zen.cpp
index 8c26bdf8f..1ac4afe5c 100644
--- a/zenserver/upstream/zen.cpp
+++ b/zenserver/upstream/zen.cpp
@@ -8,6 +8,7 @@
#include <zencore/fmtutils.h>
#include <zencore/session.h>
#include <zencore/stream.h>
+#include <zenhttp/httpcommon.h>
#include <zenhttp/httpshared.h>
#include "cache/structuredcachestore.h"
@@ -415,11 +416,7 @@ ZenStructuredCacheSession::GetCacheRecord(std::string_view BucketId, const IoHas
cpr::Session& Session = m_SessionState->GetSession();
Session.SetOption(cpr::Url{Uri.c_str()});
- Session.SetHeader(cpr::Header{{"Accept",
- Type == ZenContentType::kCbPackage ? "application/x-ue-cbpkg"
- : Type == ZenContentType::kCbObject ? "application/x-ue-cb"
- : "application/octet-stream"}});
-
+ Session.SetHeader(cpr::Header{{"Accept", std::string{MapContentTypeToString(Type)}}});
cpr::Response Response = Session.Get();
ZEN_DEBUG("GET {}", Response);