Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/wasm-go/extensions/key-auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ func onHttpRequestHeaders(ctx wrapper.HttpContext, config KeyAuthConfig, log log
return deniedUnauthorizedConsumer()
}

proxywasm.AddHttpRequestHeader("X-Mse-Consumer", name)

// 全局生效:
// - global_auth == true 且 当前 domain/route 未配置该插件
// - global_auth 未设置 且 没有任何一个 domain/route 配置该插件
Expand Down Expand Up @@ -343,7 +345,6 @@ func deniedUnauthorizedConsumer() types.Action {
}

func authenticated(name string) types.Action {
_ = proxywasm.AddHttpRequestHeader("X-Mse-Consumer", name)
return types.ActionContinue
}

Expand Down
Loading