Skip to content

fix: return early after error in impersonateHandler#1043

Merged
oliverbaehler merged 1 commit into
projectcapsule:mainfrom
jouve:main
Jun 1, 2026
Merged

fix: return early after error in impersonateHandler#1043
oliverbaehler merged 1 commit into
projectcapsule:mainfrom
jouve:main

Conversation

@jouve

@jouve jouve commented May 30, 2026

Copy link
Copy Markdown
Contributor

When the user or group lookup fails, the handler was logging/responding the error but then falling through to the impersonation logic. Adding an early return prevents the request from continuing with an empty or invalid identity.

Copilot AI review requested due to automatic review settings May 30, 2026 00:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a missing return after error handling in impersonateHandler to prevent execution from continuing after an error response has been written.

Changes:

  • Add explicit return statement after handling an error in impersonateHandler.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

When the user or group lookup fails, the handler was logging/responding
the error but then falling through to the impersonation logic. Adding
an early return prevents the request from continuing with an empty or
invalid identity.

Signed-off-by: Cyril Jouve <jv.cyril@gmail.com>

@oliverbaehler oliverbaehler left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0

@oliverbaehler oliverbaehler merged commit dfb8641 into projectcapsule:main Jun 1, 2026
12 checks passed
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.

3 participants