projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RichMedia: Fix log spam on failures and resetting TTL on cached errors
[akkoma]
/
lib
/
pleroma
/
signature.ex
diff --git
a/lib/pleroma/signature.ex
b/lib/pleroma/signature.ex
index 7006eb2c05ec6db2d16eac147ea69e67f2636597..3aa6909d2f1652bf79f6312381a12de130fcd232 100644
(file)
--- a/
lib/pleroma/signature.ex
+++ b/
lib/pleroma/signature.ex
@@
-5,6
+5,7
@@
defmodule Pleroma.Signature do
@behaviour HTTPSignatures.Adapter
defmodule Pleroma.Signature do
@behaviour HTTPSignatures.Adapter
+ alias Pleroma.EctoType.ActivityPub.ObjectValidators
alias Pleroma.Keys
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Keys
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
@@
-21,14
+22,16
@@
defmodule Pleroma.Signature do
uri
end
uri
end
- case uri do
- %URI{scheme: scheme} when scheme in ["https", "http"] ->
- {:ok, URI.to_string(uri)}
+ maybe_ap_id = URI.to_string(uri)
+
+ case ObjectValidators.ObjectID.cast(maybe_ap_id) do
+ {:ok, ap_id} ->
+ {:ok, ap_id}
_ ->
_ ->
- case Pleroma.Web.WebFinger.finger(
URI.to_string(uri)
) do
+ case Pleroma.Web.WebFinger.finger(
maybe_ap_id
) do
%{"ap_id" => ap_id} -> {:ok, ap_id}
%{"ap_id" => ap_id} -> {:ok, ap_id}
- _ -> {:error,
URI.to_string(uri)
}
+ _ -> {:error,
maybe_ap_id
}
end
end
end
end
end
end