diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 816e7b4dd81e0..8866026281683 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -495,9 +495,9 @@ DEPENDENCY_REPOSITORIES = dict( cpe = "N/A", ), proxy_wasm_cpp_host = dict( - sha256 = "41c48f430bce1370abc1d0d56b82abeffc59af43309951cbf064a001e689fe19", - strip_prefix = "proxy-wasm-cpp-host-56593833008e677a99b51a78cd480391f298e226", - urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-host/archive/56593833008e677a99b51a78cd480391f298e226.tar.gz"], + sha256 = "ba42fd5a8f341cd8be49bc5470e850827127b792aa45897676eeb03385857232", + strip_prefix = "proxy-wasm-cpp-host-a013d522304658b8b79a9847381a3182b845d4df", + urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-host/archive/a013d522304658b8b79a9847381a3182b845d4df.tar.gz"], use_category = ["dataplane"], cpe = "N/A", ), diff --git a/source/extensions/common/wasm/context.cc b/source/extensions/common/wasm/context.cc index e462c5393edfb..a2ae342d887db 100644 --- a/source/extensions/common/wasm/context.cc +++ b/source/extensions/common/wasm/context.cc @@ -583,7 +583,12 @@ WasmResult Context::getHeaderMapValue(WasmHeaderMapType type, absl::string_view const Http::LowerCaseString lower_key{std::string(key)}; auto entry = map->get(lower_key); if (!entry) { - return WasmResult::NotFound; + if (wasm()->abiVersion() == proxy_wasm::AbiVersion::ProxyWasm_0_1_0) { + *value = ""; + return WasmResult::Ok; + } else { + return WasmResult::NotFound; + } } *value = entry->value().getStringView(); return WasmResult::Ok; @@ -1028,18 +1033,22 @@ bool Context::validateConfiguration(absl::string_view configuration, if (!wasm()->validate_configuration_) { return true; } - configuration_ = configuration; plugin_ = plugin_base; auto result = wasm() ->validate_configuration_(this, id_, static_cast(configuration.size())) .u64_ != 0; plugin_.reset(); - configuration_ = ""; return result; } -absl::string_view Context::getConfiguration() { return configuration_; } +absl::string_view Context::getConfiguration() { + if (plugin_) { + return plugin_->plugin_configuration_; + } else { + return wasm()->vm_configuration(); + } +}; std::pair Context::getStatus() { return std::make_pair(status_code_, status_message_); diff --git a/source/extensions/common/wasm/context.h b/source/extensions/common/wasm/context.h index 54a587d2c8d48..e01b70185237c 100644 --- a/source/extensions/common/wasm/context.h +++ b/source/extensions/common/wasm/context.h @@ -406,8 +406,7 @@ class Context : public proxy_wasm::ContextBase, Envoy::Http::StreamDecoderFilterCallbacks* decoder_callbacks_{}; Envoy::Http::StreamEncoderFilterCallbacks* encoder_callbacks_{}; - // General state. Only available (non-nullptr) during the calls requiring it (e.g. onConfigure()). - absl::string_view configuration_; + // Status. uint32_t status_code_{0}; absl::string_view status_message_;