mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
fix: purify event before publishing to other relays
This commit is contained in:
parent
f4f0c5fb86
commit
e01e0049e3
1 changed files with 2 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ import { RelayError } from '@/RelayError.ts';
|
||||||
import { AdminSigner } from '@/signers/AdminSigner.ts';
|
import { AdminSigner } from '@/signers/AdminSigner.ts';
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '@/storages.ts';
|
||||||
import { nostrNow } from '@/utils.ts';
|
import { nostrNow } from '@/utils.ts';
|
||||||
|
import { purifyEvent } from '@/storages/hydrate.ts';
|
||||||
|
|
||||||
const debug = Debug('ditto:api');
|
const debug = Debug('ditto:api');
|
||||||
|
|
||||||
|
|
@ -152,7 +153,7 @@ async function publishEvent(event: NostrEvent, c: AppContext): Promise<NostrEven
|
||||||
try {
|
try {
|
||||||
await pipeline.handleEvent(event, c.req.raw.signal);
|
await pipeline.handleEvent(event, c.req.raw.signal);
|
||||||
const client = await Storages.client();
|
const client = await Storages.client();
|
||||||
await client.event(event);
|
await client.event(purifyEvent(event));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof RelayError) {
|
if (e instanceof RelayError) {
|
||||||
throw new HTTPException(422, {
|
throw new HTTPException(422, {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue