mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
bug: signature: modify URL after error check (#10204)
Modifies the parsed URL after the error check. Avoids a potential `nil`-pointer de-reference if an invalid URL string argument is provided. No current code path triggers the `nil`-pointer de-reference. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10204 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: elle <0xllx0@noreply.codeberg.org> Co-committed-by: elle <0xllx0@noreply.codeberg.org>
This commit is contained in:
parent
655def254f
commit
f790d4dfe0
2 changed files with 11 additions and 1 deletions
|
|
@ -23,11 +23,12 @@ import (
|
|||
// Factory function for ActorID. Created struct is asserted to be valid
|
||||
func NewActorIDFromKeyID(ctx context.Context, uri string) (fm.ActorID, error) {
|
||||
parsedURI, err := url.Parse(uri)
|
||||
parsedURI.Fragment = ""
|
||||
if err != nil {
|
||||
return fm.ActorID{}, err
|
||||
}
|
||||
|
||||
parsedURI.Fragment = ""
|
||||
|
||||
actionsUser := user.NewAPServerActor()
|
||||
clientFactory, err := activitypub.GetClientFactory(ctx)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue