sort list of unrecognized params in response warning (#15073)

This commit is contained in:
Chris Capurso 2022-04-18 15:45:08 -04:00 committed by GitHub
parent 106ea2a2de
commit 46591ec54d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -295,6 +295,8 @@ func (b *Backend) HandleRequest(ctx context.Context, req *logical.Request) (*log
// If fields supplied in the request are not present in the field schema
// of the path, add a warning to the response indicating that those
// parameters will be ignored.
sort.Strings(ignored)
if len(ignored) != 0 {
resp.AddWarning(fmt.Sprintf("Endpoint ignored these unrecognized parameters: %v", ignored))
}