Skip to content

Commit

Permalink
fix: 🐛 no-cache 问题修复
Browse files Browse the repository at this point in the history
  • Loading branch information
heimanba committed Nov 6, 2024
1 parent 6ac7742 commit e9bfb83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/wasm-go/extensions/frontend-gray/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ func onHttpResponseHeader(ctx wrapper.HttpContext, grayConfig config.GrayConfig,
log.Errorf("error status: %s, error message: %v", status, err)
return types.ActionContinue
}
cacheControl, err := proxywasm.GetHttpResponseHeader("cache-control")
if err == nil && !strings.Contains(cacheControl, "no-cache") {
cacheControl, _ := proxywasm.GetHttpResponseHeader("cache-control")
if !strings.Contains(cacheControl, "no-cache") {
proxywasm.ReplaceHttpResponseHeader("cache-control", "no-cache, no-store, max-age=0, must-revalidate")
}

Expand Down

0 comments on commit e9bfb83

Please sign in to comment.