diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ef9d4e97..bb5b8fa04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## Unreleased + +## Fixed +- Support for `streams` public key URIs + ## 2023.04 ## Added diff --git a/lib/pleroma/signature.ex b/lib/pleroma/signature.ex index 1c59be9c7..b229e6296 100644 --- a/lib/pleroma/signature.ex +++ b/lib/pleroma/signature.ex @@ -17,6 +17,7 @@ defmodule Pleroma.Signature do key_id |> URI.parse() |> Map.put(:fragment, nil) + |> Map.put(:query, nil) |> remove_suffix(@known_suffixes) maybe_ap_id = URI.to_string(uri) diff --git a/test/pleroma/signature_test.exs b/test/pleroma/signature_test.exs index 59674bbc0..21e6ed161 100644 --- a/test/pleroma/signature_test.exs +++ b/test/pleroma/signature_test.exs @@ -114,6 +114,11 @@ defmodule Pleroma.SignatureTest do {:ok, "https://example.com/users/1234"} end + test "it deduces the actor ID for streams" do + assert Signature.key_id_to_actor_id("https://example.com/users/1234?operation=getkey") == + {:ok, "https://example.com/users/1234"} + end + test "it calls webfinger for 'acct:' accounts" do with_mock(Pleroma.Web.WebFinger, finger: fn _ -> {:ok, %{"ap_id" => "https://gensokyo.2hu/users/raymoo"}} end