diff --git a/lib/changelog_web/plugs/redirects.ex b/lib/changelog_web/plugs/redirects.ex index f46784439f..e1012eb0c0 100644 --- a/lib/changelog_web/plugs/redirects.ex +++ b/lib/changelog_web/plugs/redirects.ex @@ -10,7 +10,8 @@ defmodule ChangelogWeb.Plug.Redirects do @external %{ "/sentry" => "https://sentry.io/from/changelog/", "/square" => "https://developer.squareup.com/", - "/tailscale" => "https://tailscale.com/?utm_source=sponsorship&utm_medium=podcast&utm_campaign=changelog&utm_term=changelog", + "/tailscale" => + "https://tailscale.com/?utm_source=sponsorship&utm_medium=podcast&utm_campaign=changelog&utm_term=changelog", "/reactpodcast" => "https://reactpodcast.simplecast.com", "/store" => "https://merch.changelog.com" } @@ -18,6 +19,8 @@ defmodule ChangelogWeb.Plug.Redirects do @internal %{ "/rss" => "/feed", "/podcast/rss" => "/podcast/feed", + "/feed.js" => "/feed", + "/reactpodcast/feed" => "/jsparty/feed", "/team" => "/about", "/changeloggers" => "/about", "/membership" => "/++", @@ -57,7 +60,6 @@ defmodule ChangelogWeb.Plug.Redirects do defp internal_redirect(conn = %{halted: true}), do: conn - defp internal_redirect(conn = %{request_path: path}) do if destination = Map.get(@internal, path, false) do conn |> Redirect.call(to: destination) |> Plug.Conn.halt() diff --git a/lib/changelog_web/router.ex b/lib/changelog_web/router.ex index dc2fe0d63d..3d9d0f570e 100644 --- a/lib/changelog_web/router.ex +++ b/lib/changelog_web/router.ex @@ -35,6 +35,7 @@ defmodule ChangelogWeb.Router do pipeline :feed do plug :accepts, ["xml"] + plug Plug.Redirects plug Plug.CacheControl end