Have push_navigate trigger a 301 redirect

Hello, all -

When I return a push_navigate(socket, to: "/some-new-place") from the mount function, it translates it into a 302. For SEO reasons it’s very important in some scenarios to redirect via 301.

In non-live-view world, this would simply be:

    |> put_status(:moved_permanently)
    |> redirect(to: "/some-new-place")

I’ve looked through the opts for push_navigate and I don’t see anything of note. Am I missing something or is my only option to try and do this via a plug (a shame)?

Thanks, all!

PR here for anyone who happens to come across this: feat: support custom redirect statuses by coladarci · Pull Request #3204 · phoenixframework/phoenix_live_view · GitHub