Refactor delete handling and improve logging in event processing
- Updated the HandleDelete function to allow delete events to be stored even if no valid targets are found, enhancing flexibility in event management. - Improved logging to provide clearer insights when no deletions are processed, ensuring that issues are logged without blocking event acceptance. - Refactored SHA256 validation tests and adjusted expected values to ensure accuracy in hash comparisons. - Enhanced various test cases to improve coverage and reliability across the application.
This commit is contained in:
@@ -246,9 +246,9 @@ func ValidateAuthEventForGet(
|
||||
return
|
||||
}
|
||||
|
||||
// Otherwise, verify at least one x tag matches the hash
|
||||
if sha256Hash != nil && len(sha256Hash) > 0 {
|
||||
sha256Hex := hex.Enc(sha256Hash)
|
||||
// Otherwise, verify at least one x tag matches the hash
|
||||
if sha256Hash != nil && len(sha256Hash) > 0 {
|
||||
sha256Hex := hex.Enc(sha256Hash)
|
||||
found := false
|
||||
for _, xTag := range xTags {
|
||||
if string(xTag.Value()) == sha256Hex {
|
||||
@@ -293,4 +293,3 @@ func GetPubkeyFromRequest(r *http.Request) (pubkey []byte, err error) {
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user