summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-12-08 16:36:22 +0300
committerrinpatch <rinpatch@sdf.org>2020-02-09 00:44:29 +0300
commita87843693b87f24c7217e5dd7e0823835732687c (patch)
treecdb5c1413c264b7c33c84632ae872e7d3ba4200f
parent1629fa2412b877f69c5cf0df09782227827b272b (diff)
Fix never matching clause
`length/1` is only used with lists.
-rw-r--r--lib/pleroma/web/activity_pub/transmogrifier.ex2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex
index 1c67fee2e..e925aae2f 100644
--- a/lib/pleroma/web/activity_pub/transmogrifier.ex
+++ b/lib/pleroma/web/activity_pub/transmogrifier.ex
@@ -416,7 +416,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
def handle_incoming(%{"id" => nil}, _options), do: :error
def handle_incoming(%{"id" => ""}, _options), do: :error
# length of https:// = 8, should validate better, but good enough for now.
- def handle_incoming(%{"id" => id}, _options) when not (is_binary(id) and length(id) > 8),
+ def handle_incoming(%{"id" => id}, _options) when is_binary(id) and byte_size(id) < 8,
do: :error
# TODO: validate those with a Ecto scheme