Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
incusd/images: Fix image access through secret
In a clustered environment, we may need to forward the image download request to another server. This happens in cases where an image isn't locally available. That operation happens after secret validation and so after having invalidated the secret. The target server will validate the secret again, so we must ensure it's still considered valid. For that reason our check already allowed canceled but not expired operations, giving a 5s time window to perform any follow up requests before the token is fully expired. Unfortunately the token cancelation code would then be called again and fail as the operation was already canceled. The fix is simply to only call the cancelation code if the operation hasn't been canceled yet. Signed-off-by: Stéphane Graber <[email protected]>
- Loading branch information