Skip to content

Commit

Permalink
fix: Fix the incorrect usage of DisableReroute (#991)
Browse files Browse the repository at this point in the history
  • Loading branch information
CH3CHO committed May 23, 2024
1 parent 10f1adc commit 7fcb608
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/wasm-go/extensions/ai-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ func onHttpRequestHeader(ctx wrapper.HttpContext, pluginConfig config.PluginConf
ctx.SetContext(ctxKeyApiName, apiName)

if handler, ok := activeProvider.(provider.RequestHeadersHandler); ok {
// Disable the route re-calculation since the plugin may modify some headers related to the chosen route.
ctx.DisableReroute()

action, err := handler.OnRequestHeaders(ctx, apiName, log)
if err == nil {
return action
Expand Down Expand Up @@ -153,9 +156,6 @@ func onHttpResponseHeaders(ctx wrapper.HttpContext, pluginConfig config.PluginCo
ctx.BufferResponseBody()
}

// Disable the route re-calculation since the plugin may modify some headers related to the chosen route.
ctx.DisableReroute()

return types.ActionContinue
}

Expand Down

0 comments on commit 7fcb608

Please sign in to comment.