mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-09 10:22:32 +00:00
fix: misc fixes in pub/gpg/tests (#38809)
- The pub registry reported the oldest version as `latest`, because the descriptor slice is sorted ascending but the first element was used. - Verifying a GPG or SSH key flashed success and redirected after already writing an error response, so a failure was reported as a success with an empty key id. - Test packages sharing redis could tear down each other's server. `PrepareTestRedis` started its own on the well-known port, so a package running in parallel borrowed it and lost it when the owner's cleanup fired. It now listens on a socket of its own.
This commit is contained in:
@@ -161,6 +161,7 @@ func KeysPost(ctx *context.Context) {
|
||||
default:
|
||||
ctx.ServerError("VerifyGPG", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
ctx.Flash.Success(ctx.Tr("settings.verify_gpg_key_success", keyID))
|
||||
ctx.Redirect(setting.AppSubURL + "/user/settings/keys")
|
||||
@@ -232,6 +233,7 @@ func KeysPost(ctx *context.Context) {
|
||||
default:
|
||||
ctx.ServerError("VerifySSH", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
ctx.Flash.Success(ctx.Tr("settings.verify_ssh_key_success", fingerprint))
|
||||
ctx.Redirect(setting.AppSubURL + "/user/settings/keys")
|
||||
|
||||
Reference in New Issue
Block a user