Lua: Extract external auth into file. (#12250)

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
This commit is contained in:
Ricardo Katz 2024-10-29 10:22:54 -03:00 committed by GitHub
parent 6608eb23b0
commit 7356c4f40f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 40 additions and 28 deletions

View file

@ -537,10 +537,7 @@ func TestBuildAuthResponseHeaders(t *testing.T) {
func TestBuildAuthResponseLua(t *testing.T) {
externalAuthResponseHeaders := []string{"h1", "H-With-Caps-And-Dashes"}
expected := []string{
"ngx.var.authHeader0 = res.header['h1']",
"ngx.var.authHeader1 = res.header['H-With-Caps-And-Dashes']",
}
expected := "h1,H-With-Caps-And-Dashes"
headers := buildAuthUpstreamLuaHeaders(externalAuthResponseHeaders)