Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
Expand Down
17 changes: 13 additions & 4 deletions source/extensions/common/wasm/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<uint32_t>(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<uint32_t, absl::string_view> Context::getStatus() {
return std::make_pair(status_code_, status_message_);
Expand Down
3 changes: 1 addition & 2 deletions source/extensions/common/wasm/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;

Expand Down