Merge remote-tracking branch 'remotes/origin/develop' into output-of-relationships...
[akkoma] / lib / pleroma / web / activity_pub / object_validators / types / object_id.ex
index ee10be0b0d0417d7672bdbc5f1748901640757cf..f6e749b337249db0c71e0d1b5b0ebc7dcbababd5 100644 (file)
@@ -6,14 +6,10 @@ 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
-      %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