Merge branch 'develop' into 'remove-twitter-api'
[akkoma] / lib / pleroma / web / web_finger / web_finger.ex
index 84ece1be295d44672299a98c9a101f626342b7db..71ccf251a8c79cdaf540e6a28193f60e87b6cbc1 100644 (file)
@@ -161,13 +161,15 @@ defmodule Pleroma.Web.WebFinger do
           URI.parse(account).host
       end
 
+    encoded_account = URI.encode("acct:#{account}")
+
     address =
       case find_lrdd_template(domain) do
         {:ok, template} ->
-          String.replace(template, "{uri}", URI.encode(account))
+          String.replace(template, "{uri}", encoded_account)
 
         _ ->
-          "https://#{domain}/.well-known/webfinger?resource=acct:#{account}"
+          "https://#{domain}/.well-known/webfinger?resource=#{encoded_account}"
       end
 
     with response <-