diff options
author | 2022-05-23 17:10:48 +0200 | |
---|---|---|
committer | 2022-05-23 16:10:48 +0100 | |
commit | a09e1019317794b516585ea4ae7e88354241b444 (patch) | |
tree | fb2c785b98e235acaa2d41ea68b9bb9ca41f2f9d /internal/typeutils/astointernal.go | |
parent | [security] Check all involved IRIs during block checking (#593) (diff) | |
download | gotosocial-a09e1019317794b516585ea4ae7e88354241b444.tar.xz |
[bugfix] If status URL is empty, use URI instead and don't log unnecessary error (#597)
* test parse status with no URL
* if no status URL is available, use the URI instead
Diffstat (limited to 'internal/typeutils/astointernal.go')
-rw-r--r-- | internal/typeutils/astointernal.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/typeutils/astointernal.go b/internal/typeutils/astointernal.go index 4c8a95dfd..e8b585f5f 100644 --- a/internal/typeutils/astointernal.go +++ b/internal/typeutils/astointernal.go @@ -184,10 +184,11 @@ func (c *converter) ASStatusToStatus(ctx context.Context, statusable ap.Statusab l := logrus.WithField("statusURI", status.URI) // web url for viewing this status - if statusURL, err := ap.ExtractURL(statusable); err != nil { - l.Infof("ASStatusToStatus: error extracting status URL: %s", err) - } else { + if statusURL, err := ap.ExtractURL(statusable); err == nil { status.URL = statusURL.String() + } else { + // if no URL was set, just take the URI + status.URL = status.URI } // the html-formatted content of this status |