Skip to content

Commit ba7518d

Browse files
committed
🐛fix false error when updating blocklist
1 parent 8df52e0 commit ba7518d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
502 Bytes
Binary file not shown.

proxy/wasm/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ func (ctx *pluginContext) OnTick() {
139139
if err != nil {
140140
proxywasm.LogErrorf("{\"type\": \"system\", \"content\": \"could not read body when setting blocklist: %v\"}", err)
141141
}
142-
if string(responseBody) != "Done" {
142+
var jsonResponse map[string]interface{}
143+
json.Unmarshal(responseBody, &jsonResponse)
144+
if jsonResponse["code"] != float64(200) {
143145
proxywasm.LogErrorf("{\"type\": \"system\", \"content\": \"error when setting blocklist: %v\"}", string(responseBody))
144146
}
145147
}

0 commit comments

Comments
 (0)