add missing source url validation

This commit is contained in:
byte[] 2020-07-13 23:51:50 -04:00
parent b97073ee18
commit 799edcb50f

View file

@ -119,6 +119,7 @@ defmodule Philomena.Images.Image do
|> change(first_seen_at: now) |> change(first_seen_at: now)
|> change(attribution) |> change(attribution)
|> validate_length(:description, max: 50_000, count: :bytes) |> validate_length(:description, max: 50_000, count: :bytes)
|> validate_format(:source_url, ~r/\Ahttps?:\/\//)
end end
def image_changeset(image, attrs) do def image_changeset(image, attrs) do