Skip to content

Commit

Permalink
Add signature to cache only when sign successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
peterlimg committed Sep 28, 2024
1 parent db70fda commit c7eb875
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zboxcore/zboxutil/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,12 @@ func setClientInfoWithSign(req *http.Request, sig, allocation, baseURL string) e
if !ok {
var err error
sig2, err = client.Sign(encryption.Hash(hashData))
SignCache.Add(hashData, sig2)
if err != nil {
return err
}
SignCache.Add(hashData, sig2)
}

req.Header.Set(CLIENT_SIGNATURE_HEADER_V2, sig2)
return nil
}
Expand Down

0 comments on commit c7eb875

Please sign in to comment.