Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: missing return in handle_get_credentials #2195

Merged
merged 1 commit into from
May 21, 2024

Conversation

mattmundell
Copy link
Contributor

What

In the GET_CREDENTIALS handler, add a return after the credential format error.

Why

The return is required else gvmd sends the credentials after the error response.

This format error can be invoked by calling GET_CREDENTIALS with an erroneous format attribute, for example:

$ o m m '<get_credentials format="err" filter="rows=1 sort=name"/>'

Here's the response before the PR (note the extra get_credentials_response element):

<get_credentials_response status="400" status_text="Format attribute should be 'key', 'rpm', 'deb', 'exe' or 'pem'" />
<get_credentials_response status="200" status_text="OK">
  <credential id="c1e69303-bd6b-4c02-860b-8c41f34064f4">
  ...

Here's the response after the PR, with the single correct element:

<get_credentials_response status="400"
status_text="Format attribute should be 'key', 'rpm', 'deb', 'exe' or 'pem'" />```

@mattmundell mattmundell requested a review from a team as a code owner May 13, 2024 15:36
Copy link

Conventional Commits Report

Type Number
Bug Fixes 1

🚀 Conventional commits found.

@a-h-abdelsalam a-h-abdelsalam force-pushed the get-credentials-missing-return-2 branch from 464e56a to 0fdd842 Compare May 21, 2024 14:36
@a-h-abdelsalam a-h-abdelsalam enabled auto-merge May 21, 2024 16:09
@a-h-abdelsalam a-h-abdelsalam merged commit 41f2c16 into main May 21, 2024
9 checks passed
@a-h-abdelsalam a-h-abdelsalam deleted the get-credentials-missing-return-2 branch May 21, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants