From 442bdf93553fa469df3fb74b5537552401a35674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BE=84=E6=BD=AD?= Date: Mon, 20 Feb 2023 20:14:55 +0800 Subject: [PATCH] Enhance the compatibility of wasm-go sdk for route matching (#205) --- plugins/wasm-go/pkg/matcher/rule_matcher.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/wasm-go/pkg/matcher/rule_matcher.go b/plugins/wasm-go/pkg/matcher/rule_matcher.go index df77e09c7..7937e81f3 100644 --- a/plugins/wasm-go/pkg/matcher/rule_matcher.go +++ b/plugins/wasm-go/pkg/matcher/rule_matcher.go @@ -20,6 +20,7 @@ import ( "strings" "github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm" + "github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm/types" "github.com/tidwall/gjson" ) @@ -68,7 +69,7 @@ func (m RuleMatcher[PluginConfig]) GetMatchConfig() (*PluginConfig, error) { return nil, err } routeName, err := proxywasm.GetProperty([]string{"route_name"}) - if err != nil { + if err != nil && err != types.ErrorStatusNotFound { return nil, err } for _, rule := range m.ruleConfig {