1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

review: fix various issues brought up by Gusted

This commit is contained in:
Kwonunn 2025-01-26 11:50:03 +01:00 committed by Kwonunn
parent 7a21d64333
commit ef43d7c615
2 changed files with 20 additions and 13 deletions

View file

@ -25,7 +25,7 @@ func (h *Handler) validateMac(rundata cacheproxy.RunData) (string, error) {
}
expectedMAC := computeMac(h.secret, rundata.RepositoryFullName, rundata.RunNumber, rundata.Timestamp)
if expectedMAC == rundata.RepositoryMAC {
if hmac.Equal([]byte(expectedMAC), []byte(rundata.RepositoryMAC)) {
return rundata.RepositoryFullName, nil
}
return rundata.RepositoryFullName, ErrValidation