khatru: prevent large indexable tags doesn't make any sense anymore as we don't index tags verbatim, only hashes.

This commit is contained in:
fiatjaf
2025-09-04 10:13:08 -03:00
parent aec2dc318d
commit 0770f217a5
2 changed files with 0 additions and 15 deletions

View File

@@ -52,20 +52,6 @@ func PreventTooManyIndexableTags(max int, ignoreKinds []nostr.Kind, onlyKinds []
}
}
// PreventLargeTags rejects events that have indexable tag values greater than maxTagValueLen.
func PreventLargeTags(maxTagValueLen int) func(context.Context, nostr.Event) (bool, string) {
return func(ctx context.Context, event nostr.Event) (reject bool, msg string) {
for _, tag := range event.Tags {
if len(tag) > 1 && len(tag[0]) == 1 {
if len(tag[1]) > maxTagValueLen {
return true, "event contains too large tags"
}
}
}
return false, ""
}
}
// PreventLargeContent rejects events with content too large
func PreventLargeContent(maxContent int) func(context.Context, nostr.Event) (bool, string) {
return func(ctx context.Context, event nostr.Event) (reject bool, msg string) {

View File

@@ -8,7 +8,6 @@ import (
var EventRejectionStrictDefaults = SeqEvent(
RejectEventsWithBase64Media,
PreventLargeTags(100),
PreventTooManyIndexableTags(12, []nostr.Kind{3}, nil),
PreventTooManyIndexableTags(1200, nil, []nostr.Kind{3}),
PreventLargeContent(5000),