projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
object_validators
/
types
/
object_id.ex
diff --git
a/lib/pleroma/web/activity_pub/object_validators/types/object_id.ex
b/lib/pleroma/web/activity_pub/object_validators/types/object_id.ex
index ee10be0b0d0417d7672bdbc5f1748901640757cf..f71f763704be08664ec3b3b0c3461d7c6c008e9c 100644
(file)
--- a/
lib/pleroma/web/activity_pub/object_validators/types/object_id.ex
+++ b/
lib/pleroma/web/activity_pub/object_validators/types/object_id.ex
@@
-6,28
+6,18
@@
defmodule Pleroma.Web.ActivityPub.ObjectValidators.Types.ObjectID do
def cast(object) when is_binary(object) do
# Host has to be present and scheme has to be an http scheme (for now)
case URI.parse(object) do
def cast(object) when is_binary(object) do
# Host has to be present and scheme has to be an http scheme (for now)
case URI.parse(object) do
- %URI{host: nil} ->
- :error
-
- %URI{scheme: scheme} when scheme in ["https", "http"] ->
- {:ok, object}
-
- _ ->
- :error
+ %URI{host: nil} -> :error
+ %URI{host: ""} -> :error
+ %URI{scheme: scheme} when scheme in ["https", "http"] -> {:ok, object}
+ _ -> :error
end
end
def cast(%{"id" => object}), do: cast(object)
end
end
def cast(%{"id" => object}), do: cast(object)
- def cast(_) do
- :error
- end
+ def cast(_), do: :error
- def dump(data) do
- {:ok, data}
- end
+ def dump(data), do: {:ok, data}
- def load(data) do
- {:ok, data}
- end
+ def load(data), do: {:ok, data}
end
end