From 25d34e0c146a6f71f66be52d96fb7f10ce3b8ccf Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 7 Dec 2023 12:03:28 +0100 Subject: [PATCH] Check for empty path in IRI --- models/activitypub/actor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/activitypub/actor.go b/models/activitypub/actor.go index 40952bcf17..3c8f497ff4 100644 --- a/models/activitypub/actor.go +++ b/models/activitypub/actor.go @@ -134,6 +134,10 @@ func ValidateAndParseIRI(unvalidatedIRI string) (url.URL, error) { return url.URL{}, err } + if len(validatedURL.Path) <= 1 { + return url.URL{}, fmt.Errorf("path was empty") + } + return *validatedURL, nil }