From 83662e79b6c51f56a18500b022be3aa17b5325e9 Mon Sep 17 00:00:00 2001 From: kevholditch-f3 <82885135+kevholditch-f3@users.noreply.github.com> Date: Wed, 20 Oct 2021 15:49:49 +0100 Subject: [PATCH] fixes #135 (#140) --- kong/utils.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kong/utils.go b/kong/utils.go index c9c24ca..dea97df 100644 --- a/kong/utils.go +++ b/kong/utils.go @@ -78,7 +78,10 @@ func GetKongClient(opt Config) (*kong.Client, error) { var headers []string if opt.APIKey != "" { - headers = append(headers, fmt.Sprintf("kong-admin-token:%v", opt.APIKey)) + headers = append(headers, fmt.Sprintf("apikey:%v", opt.APIKey)) + } + if opt.AdminToken != "" { + headers = append(headers, fmt.Sprintf("kong-admin-token:%v", opt.AdminToken)) } if opt.Username != "" || opt.Password != "" { headers = append(headers, fmt.Sprintf("Authorization: Basic %v", basicAuth(opt.Username, opt.Password)))