You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by cm...@apache.org on 2024/07/09 18:49:39 UTC
(trafficserver) 06/15: wasm plugin: Initialize SanitizationConfig (#11507)
This is an automated email from the ASF dual-hosted git repository.
cmcfarlen pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 11ce71edf7a589eb880d03f8b57ab240c836597a
Author: Kit Chan <ki...@apache.org>
AuthorDate: Mon Jul 8 09:50:43 2024 -0700
wasm plugin: Initialize SanitizationConfig (#11507)
* Update wasm.h
* Update wasm_main.cc
(cherry picked from commit 84206a8c089e56efc59fd08f2e3b693c413aaf03)
---
plugins/experimental/wasm/lib/include/proxy-wasm/wasm.h | 4 ++--
plugins/experimental/wasm/wasm_main.cc | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/plugins/experimental/wasm/lib/include/proxy-wasm/wasm.h b/plugins/experimental/wasm/lib/include/proxy-wasm/wasm.h
index 9b2fec31a9..1a785a8f9a 100644
--- a/plugins/experimental/wasm/lib/include/proxy-wasm/wasm.h
+++ b/plugins/experimental/wasm/lib/include/proxy-wasm/wasm.h
@@ -40,8 +40,8 @@ using WasmVmFactory = std::function<std::unique_ptr<WasmVm>()>;
using CallOnThreadFunction = std::function<void(std::function<void()>)>;
struct SanitizationConfig {
- std::vector<std::string> argument_list{};
- bool is_allowlist{false};
+ std::vector<std::string> argument_list;
+ bool is_allowlist;
};
using AllowedCapabilitiesMap = std::unordered_map<std::string, SanitizationConfig>;
diff --git a/plugins/experimental/wasm/wasm_main.cc b/plugins/experimental/wasm/wasm_main.cc
index 8692d75dc8..6e7c32a31a 100644
--- a/plugins/experimental/wasm/wasm_main.cc
+++ b/plugins/experimental/wasm/wasm_main.cc
@@ -676,7 +676,9 @@ read_configuration()
for (const auto &i : ac_node) {
auto ac = i.as<std::string>();
proxy_wasm::SanitizationConfig sc;
- cap_maps[ac] = sc;
+ sc.argument_list = {};
+ sc.is_allowlist = false;
+ cap_maps[ac] = sc;
}
}
}