From a026ccda607c4890f59d86c9205ddf23d4fa5529 Mon Sep 17 00:00:00 2001 From: Gavin Halliday Date: Wed, 27 Sep 2023 14:30:05 +0100 Subject: [PATCH] Changes following review Signed-off-by: Gavin Halliday --- esp/services/ws_ecl/ws_ecl_service.hpp | 8 ++++---- roxie/ccd/ccdprotocol.cpp | 8 ++++---- system/jlib/jtrace.hpp | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/esp/services/ws_ecl/ws_ecl_service.hpp b/esp/services/ws_ecl/ws_ecl_service.hpp index e6fd9461dd0..e6e354b92e0 100644 --- a/esp/services/ws_ecl/ws_ecl_service.hpp +++ b/esp/services/ws_ecl/ws_ecl_service.hpp @@ -122,14 +122,14 @@ class CWsEclService : public CInterface, StringBuffer &getHttpGlobalIdHeader(CHttpRequest *request, StringBuffer &value) { - if (!getHttpIdHeader(request, "Global-Id", value)) - getHttpIdHeader(request, "HPCC-Global-Id", value); + if (!getHttpIdHeader(request, kGlobalIdHttpHeaderName, value)) + getHttpIdHeader(request, kLegacyGlobalIdHttpHeaderName, value); return value; } StringBuffer &getHttpCallerIdHeader(CHttpRequest *request, StringBuffer &value) { - if (!getHttpIdHeader(request, "Caller-Id", value)) - getHttpIdHeader(request, "HPCC-Caller-Id", value); + if (!getHttpIdHeader(request, kCallerIdHttpHeaderName, value)) + getHttpIdHeader(request, kLegacyCallerIdHttpHeaderName, value); return value; } diff --git a/roxie/ccd/ccdprotocol.cpp b/roxie/ccd/ccdprotocol.cpp index 9d06a0a29d5..1cf57813385 100644 --- a/roxie/ccd/ccdprotocol.cpp +++ b/roxie/ccd/ccdprotocol.cpp @@ -1689,17 +1689,17 @@ class RoxieSocketWorker : public ProtocolQueryWorker const char *queryRequestGlobalIdHeader(HttpHelper &httpHelper, IContextLogger &logctx) { - const char *id = httpHelper.queryRequestHeader("Global-Id"); + const char *id = httpHelper.queryRequestHeader(kGlobalIdHttpHeaderName); if (!id || !*id) - id = httpHelper.queryRequestHeader("HPCC-Global-Id"); // Backward compatibility - passed on as global-id + id = httpHelper.queryRequestHeader(kLegacyGlobalIdHttpHeaderName); // Backward compatibility - passed on as global-id return id; } const char *queryRequestCallerIdHeader(HttpHelper &httpHelper, IContextLogger &logctxheaderused) { - const char *id = httpHelper.queryRequestHeader("Caller-Id"); + const char *id = httpHelper.queryRequestHeader(kCallerIdHttpHeaderName); if (!id || !*id) - id = httpHelper.queryRequestHeader("HPCC-Caller-Id"); // Backward compatibility - passed on as caller-id + id = httpHelper.queryRequestHeader(kLegacyCallerIdHttpHeaderName); // Backward compatibility - passed on as caller-id return id; } diff --git a/system/jlib/jtrace.hpp b/system/jlib/jtrace.hpp index bc69a91de25..2094dd9b14a 100644 --- a/system/jlib/jtrace.hpp +++ b/system/jlib/jtrace.hpp @@ -23,10 +23,10 @@ * Known HPCC span Keys could be added here * Specialized span keys can also be defined within the scope of a span */ -static constexpr const char *kGlobalIdHttpHeaderName = "global-id"; -static constexpr const char *kCallerIdHttpHeaderName = "caller-id"; -static constexpr const char *kLegacyGlobalIdHttpHeaderName = "hpcc-global-id"; -static constexpr const char *kLegacyCallerIdHttpHeaderName = "hpcc-caller-id"; +static constexpr const char *kGlobalIdHttpHeaderName = "Global-Id"; +static constexpr const char *kCallerIdHttpHeaderName = "Caller-Id"; +static constexpr const char *kLegacyGlobalIdHttpHeaderName = "HPCC-Global-Id"; +static constexpr const char *kLegacyCallerIdHttpHeaderName = "HPCC-Caller-Id"; class jlib_decl LogTrace {