mirror of
https://github.com/alibaba/higress.git
synced 2026-04-21 03:57:28 +08:00
feat: get_match_config returns with rule_id for stateful plugins (#406)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
use higress_wasm_rust::log::Log;
|
||||
use higress_wasm_rust::rule_matcher::{on_configure, RuleMatcher};
|
||||
use higress_wasm_rust::rule_matcher::{on_configure, RuleMatcher, SharedRuleMatcher};
|
||||
use proxy_wasm::traits::{Context, HttpContext, RootContext};
|
||||
use proxy_wasm::types::{Action, ContextType, LogLevel};
|
||||
use serde::Deserialize;
|
||||
@@ -28,11 +28,11 @@ proxy_wasm::main! {{
|
||||
|
||||
struct SayHelloRoot {
|
||||
log: Log,
|
||||
rule_matcher: Rc<RefCell<RuleMatcher<SayHelloConfig>>>,
|
||||
rule_matcher: SharedRuleMatcher<SayHelloConfig>,
|
||||
}
|
||||
|
||||
struct SayHello {
|
||||
rule_matcher: Rc<RefCell<RuleMatcher<SayHelloConfig>>>,
|
||||
rule_matcher: SharedRuleMatcher<SayHelloConfig>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Deserialize)]
|
||||
@@ -82,7 +82,7 @@ impl HttpContext for SayHello {
|
||||
self.send_http_response(200, vec![], Some("Hello, World!".as_bytes()));
|
||||
return Action::Continue;
|
||||
}
|
||||
Some(config) => config,
|
||||
Some(config) => config.1,
|
||||
};
|
||||
|
||||
self.send_http_response(
|
||||
|
||||
Reference in New Issue
Block a user