Merge branch 'bugfix/webfinger-xml-crash' into 'develop'
[akkoma] / lib / pleroma / web / web_finger / web_finger.ex
index 6e5fc140185dcbfa122c5c701e6232b887e36534..0b417479d069a59b3c0950b75d3870f2ffc075b7 100644 (file)
@@ -214,7 +214,7 @@ defmodule Pleroma.Web.WebFinger do
   end
 
   def get_template_from_xml(body) do
-    xpath = "//Link[@rel='lrdd' and @type='application/xrd+xml']/@template"
+    xpath = "//Link[@rel='lrdd']/@template"
 
     with doc when doc != :error <- XML.parse_document(body),
          template when template != nil <- XML.string_from_xpath(xpath, doc) do
@@ -253,7 +253,7 @@ defmodule Pleroma.Web.WebFinger do
           String.replace(template, "{uri}", URI.encode(account))
 
         _ ->
-          "http://#{domain}/.well-known/webfinger?resource=acct:#{account}"
+          "https://#{domain}/.well-known/webfinger?resource=acct:#{account}"
       end
 
     with response <-