you have to halt the plug pipeline explicitly

This commit is contained in:
byte[] 2020-05-04 03:18:36 -04:00
parent 6d673a4fed
commit 4b86e783ef
10 changed files with 10 additions and 1 deletions

View file

@ -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)

View file

@ -47,6 +47,7 @@ defmodule PhilomenaWeb.Filter.HideController do
conn
|> put_status(:forbidden)
|> text("")
|> halt()
end
end
end

View file

@ -47,6 +47,7 @@ defmodule PhilomenaWeb.Filter.SpoilerController do
conn
|> put_status(:forbidden)
|> text("")
|> halt()
end
end
end

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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