Skip to content

Commit 8815b45

Browse files
authored
fix: default port of static service in ai-cache plugin (alibaba#1591)
1 parent e67c824 commit 8815b45

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

plugins/wasm-go/extensions/ai-cache/cache/provider.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cache
22

33
import (
44
"errors"
5+
"strings"
56

67
"github.com/alibaba/higress/plugins/wasm-go/pkg/wrapper"
78
"github.com/tidwall/gjson"
@@ -62,7 +63,12 @@ func (c *ProviderConfig) FromJson(json gjson.Result) {
6263
c.serviceName = json.Get("serviceName").String()
6364
c.servicePort = int(json.Get("servicePort").Int())
6465
if !json.Get("servicePort").Exists() {
65-
c.servicePort = 6379
66+
if strings.HasSuffix(c.serviceName, ".static") {
67+
// use default logic port which is 80 for static service
68+
c.servicePort = 80
69+
} else {
70+
c.servicePort = 6379
71+
}
6672
}
6773
c.serviceHost = json.Get("serviceHost").String()
6874
c.username = json.Get("username").String()

0 commit comments

Comments
 (0)