From 6b4f6dc7555e4a4a632ee1654596b8ed4d09853e Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 26 Apr 2023 17:17:22 +0200 Subject: [bugfix] Fix remaining mangled URI escaping issues in statuses + accounts (#1712) * start fiddling with normalize + extract functions * normalize attachment name (image description) * NormalizeAccountableSummary * normalize summary + name --- internal/ap/resolve.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'internal/ap/resolve.go') diff --git a/internal/ap/resolve.go b/internal/ap/resolve.go index c5c9efd65..8d116751c 100644 --- a/internal/ap/resolve.go +++ b/internal/ap/resolve.go @@ -27,8 +27,7 @@ import ( ) // ResolveStatusable tries to resolve the given bytes into an ActivityPub Statusable representation. -// It will then perform normalization on the Statusable by calling NormalizeStatusable, so that -// callers don't need to bother doing extra steps. +// It will then perform normalization on the Statusable. // // Works for: Article, Document, Image, Video, Note, Page, Event, Place, Profile func ResolveStatusable(ctx context.Context, b []byte) (Statusable, error) { @@ -73,11 +72,16 @@ func ResolveStatusable(ctx context.Context, b []byte) (Statusable, error) { return nil, newErrWrongType(err) } - NormalizeStatusableContent(statusable, rawStatusable) + NormalizeContent(statusable, rawStatusable) + NormalizeAttachments(statusable, rawStatusable) + NormalizeSummary(statusable, rawStatusable) + NormalizeName(statusable, rawStatusable) + return statusable, nil } // ResolveStatusable tries to resolve the given bytes into an ActivityPub Accountable representation. +// It will then perform normalization on the Accountable. // // Works for: Application, Group, Organization, Person, Service func ResolveAccountable(ctx context.Context, b []byte) (Accountable, error) { @@ -114,5 +118,7 @@ func ResolveAccountable(ctx context.Context, b []byte) (Accountable, error) { return nil, newErrWrongType(err) } + NormalizeSummary(accountable, rawAccountable) + return accountable, nil } -- cgit v1.2.3