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
6 changes: 4 additions & 2 deletions pkg/openapi/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func HandleAuths(req *http.Request, envMap map[string]string, infoSets [][]Secur

// We're using this info set, because no environment variables were missing.
// Set up the request as needed.
v := url.Values{}
for _, info := range infoSet {
envNames := maps.Values(info.getCredentialNamesAndEnvVars(req.URL.Hostname()))
switch info.Type {
Expand All @@ -185,9 +186,7 @@ func HandleAuths(req *http.Request, envMap map[string]string, infoSets [][]Secur
case "header":
req.Header.Set(info.APIKeyName, envMap[envNames[0]])
case "query":
v := url.Values{}
v.Add(info.APIKeyName, envMap[envNames[0]])
req.URL.RawQuery = v.Encode()
case "cookie":
req.AddCookie(&http.Cookie{
Name: info.APIKeyName,
Expand All @@ -203,6 +202,9 @@ func HandleAuths(req *http.Request, envMap map[string]string, infoSets [][]Secur
}
}
}
if len(v) > 0 {
req.URL.RawQuery = v.Encode()
}
return nil
}

Expand Down