projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add `/api/v1/notifications/:id/dismiss` endpoint
[akkoma]
/
lib
/
pleroma
/
web
/
web_finger
/
web_finger.ex
diff --git
a/lib/pleroma/web/web_finger/web_finger.ex
b/lib/pleroma/web/web_finger/web_finger.ex
index b4cc801799e97a5fa3224875136bd0a645e98acb..7ffd0e51bbfbef242fddcb22bc97790cb00fd3a6 100644
(file)
--- a/
lib/pleroma/web/web_finger/web_finger.ex
+++ b/
lib/pleroma/web/web_finger/web_finger.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.WebFinger do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.WebFinger do
@@
-173,7
+173,8
@@
defmodule Pleroma.Web.WebFinger do
get_template_from_xml(body)
else
_ ->
get_template_from_xml(body)
else
_ ->
- with {:ok, %{body: body}} <- HTTP.get("https://#{domain}/.well-known/host-meta", []) do
+ with {:ok, %{body: body, status: status}} when status in 200..299 <-
+ HTTP.get("https://#{domain}/.well-known/host-meta", []) do
get_template_from_xml(body)
else
e -> {:error, "Can't find LRDD template: #{inspect(e)}"}
get_template_from_xml(body)
else
e -> {:error, "Can't find LRDD template: #{inspect(e)}"}
@@
-205,7
+206,7
@@
defmodule Pleroma.Web.WebFinger do
with response <-
HTTP.get(
address,
with response <-
HTTP.get(
address,
- Accept: "application/xrd+xml,application/jrd+json"
+ [{"accept", "application/xrd+xml,application/jrd+json"}]
),
{:ok, %{status: status, body: body}} when status in 200..299 <- response do
doc = XML.parse_document(body)
),
{:ok, %{status: status, body: body}} when status in 200..299 <- response do
doc = XML.parse_document(body)