diff --git a/lib/philomena_web/controllers/api/json/image/featured_controller.ex b/lib/philomena_web/controllers/api/json/image/featured_controller.ex index b6a5a0ea..b2cbbbb9 100644 --- a/lib/philomena_web/controllers/api/json/image/featured_controller.ex +++ b/lib/philomena_web/controllers/api/json/image/featured_controller.ex @@ -23,6 +23,7 @@ defmodule PhilomenaWeb.Api.Json.Image.FeaturedController do conn |> put_status(:not_found) |> text("") + |> halt() _ -> interactions = Interactions.user_interactions([featured_image], user) diff --git a/lib/philomena_web/controllers/filter/hide_controller.ex b/lib/philomena_web/controllers/filter/hide_controller.ex index fcf0f387..622d0399 100644 --- a/lib/philomena_web/controllers/filter/hide_controller.ex +++ b/lib/philomena_web/controllers/filter/hide_controller.ex @@ -47,6 +47,7 @@ defmodule PhilomenaWeb.Filter.HideController do conn |> put_status(:forbidden) |> text("") + |> halt() end end end diff --git a/lib/philomena_web/controllers/filter/spoiler_controller.ex b/lib/philomena_web/controllers/filter/spoiler_controller.ex index 4f568fa6..3522bd8d 100644 --- a/lib/philomena_web/controllers/filter/spoiler_controller.ex +++ b/lib/philomena_web/controllers/filter/spoiler_controller.ex @@ -47,6 +47,7 @@ defmodule PhilomenaWeb.Filter.SpoilerController do conn |> put_status(:forbidden) |> text("") + |> halt() end end end diff --git a/lib/philomena_web/controllers/image/delete_controller.ex b/lib/philomena_web/controllers/image/delete_controller.ex index 92984db0..277d51d6 100644 --- a/lib/philomena_web/controllers/image/delete_controller.ex +++ b/lib/philomena_web/controllers/image/delete_controller.ex @@ -59,6 +59,7 @@ defmodule PhilomenaWeb.Image.DeleteController do conn |> put_flash(:error, "Cannot change hide reason on a non-hidden image!") |> redirect(to: Routes.image_path(conn, :show, conn.assigns.image)) + |> halt() end end diff --git a/lib/philomena_web/controllers/image/feature_controller.ex b/lib/philomena_web/controllers/image/feature_controller.ex index b2ddb33e..8d8f604f 100644 --- a/lib/philomena_web/controllers/image/feature_controller.ex +++ b/lib/philomena_web/controllers/image/feature_controller.ex @@ -24,6 +24,7 @@ defmodule PhilomenaWeb.Image.FeatureController do conn |> put_flash(:error, "Cannot feature a hidden image.") |> redirect(to: Routes.image_path(conn, :show, conn.assigns.image)) + |> halt() _false -> conn diff --git a/lib/philomena_web/controllers/image/file_controller.ex b/lib/philomena_web/controllers/image/file_controller.ex index 49e0e0f4..191dda36 100644 --- a/lib/philomena_web/controllers/image/file_controller.ex +++ b/lib/philomena_web/controllers/image/file_controller.ex @@ -35,6 +35,7 @@ defmodule PhilomenaWeb.Image.FileController do conn |> put_flash(:error, "Cannot replace a hidden image.") |> redirect(to: Routes.image_path(conn, :show, conn.assigns.image)) + |> halt() _false -> conn diff --git a/lib/philomena_web/controllers/image_controller.ex b/lib/philomena_web/controllers/image_controller.ex index feb9cce4..a710bdce 100644 --- a/lib/philomena_web/controllers/image_controller.ex +++ b/lib/philomena_web/controllers/image_controller.ex @@ -188,7 +188,7 @@ defmodule PhilomenaWeb.ImageController do "The image you were looking for has been marked a duplicate of the image below" ) |> redirect(to: Routes.image_path(conn, :show, image.duplicate_id)) - |> Plug.Conn.halt() + |> halt() true -> conn diff --git a/lib/philomena_web/controllers/profile/commission_controller.ex b/lib/philomena_web/controllers/profile/commission_controller.ex index 9effeb31..bdf7fe52 100644 --- a/lib/philomena_web/controllers/profile/commission_controller.ex +++ b/lib/philomena_web/controllers/profile/commission_controller.ex @@ -149,6 +149,7 @@ defmodule PhilomenaWeb.Profile.CommissionController do conn |> put_flash(:error, "You must have a verified user link to create a commission listing.") |> redirect(to: Routes.commission_path(conn, :index)) + |> halt() end end end diff --git a/lib/philomena_web/controllers/tag_controller.ex b/lib/philomena_web/controllers/tag_controller.ex index 2267ed68..3de9c04e 100644 --- a/lib/philomena_web/controllers/tag_controller.ex +++ b/lib/philomena_web/controllers/tag_controller.ex @@ -153,6 +153,7 @@ defmodule PhilomenaWeb.TagController do "This tag (\"#{conn.assigns.tag.name}\") has been aliased into the tag \"#{tag.name}\"." ) |> redirect(to: Routes.tag_path(conn, :show, tag)) + |> halt() end end end diff --git a/lib/philomena_web/plugs/ensure_user_enabled_plug.ex b/lib/philomena_web/plugs/ensure_user_enabled_plug.ex index 0bb98168..ff2e9385 100644 --- a/lib/philomena_web/plugs/ensure_user_enabled_plug.ex +++ b/lib/philomena_web/plugs/ensure_user_enabled_plug.ex @@ -31,6 +31,7 @@ defmodule PhilomenaWeb.EnsureUserEnabledPlug do conn |> Plug.delete() |> Controller.redirect(to: Routes.pow_session_path(conn, :new)) + |> Conn.halt() end defp maybe_halt(_any, conn), do: conn