Skip to content

Commit 86fbcae

Browse files
fix: add suggested comment
1 parent d9ee37c commit 86fbcae

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/handlers/event-message-handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ export class EventMessageHandler implements IMessageHandler {
247247
return 'blocked: reposts must not embed protected events'
248248
}
249249
} catch (_e) {
250+
// Ignore invalid JSON: repost content is not a valid embedded event
250251
}
251252
}
252253
}

test/unit/handlers/event-message-handler.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,7 +2139,7 @@ describe('EventMessageHandler', () => {
21392139
})
21402140

21412141
it('returns reason if event has a protected tag', () => {
2142-
event.tags = [['-']]
2142+
event.tags = [['-']] as any
21432143
expect((handler as any).isProtectedEventBlocked(event)).to.equal(
21442144
'auth-required: this event may only be published by its author',
21452145
)
@@ -2219,7 +2219,7 @@ describe('EventMessageHandler', () => {
22192219
sig: 'c'.repeat(128),
22202220
created_at: 1000,
22212221
})
2222-
event.tags = [['-']]
2222+
event.tags = [['-']] as any
22232223
expect((handler as any).isProtectedEventBlocked(event)).to.equal(
22242224
'auth-required: this event may only be published by its author',
22252225
)

0 commit comments

Comments
 (0)