Skip to content

Change redirects from external to internal where possible #5331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

zoldar
Copy link
Contributor

@zoldar zoldar commented Apr 15, 2025

Changes

We've been using redirect(external: ...) for all paths containing domain because in the past, Phoenix's redirect was overzealous when sanitizing the URL, effectively rejecting URL-encoded UTF8 characters (starting with %). Current version of phoenix has that sanitization relaxed and relying on external redirects is no longer necessary.

@@ -185,8 +185,8 @@ defmodule PlausibleWeb.Live.Verification do
end

defp redirect_to_stats(socket) do
stats_url = Routes.stats_url(PlausibleWeb.Endpoint, :stats, socket.assigns.domain, [])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a particular reason for using _url instead of _path helper here? 🤔 \cc @aerosol

@zoldar zoldar added the preview label Apr 15, 2025
Copy link

Preview environment👷🏼‍♀️🏗️
PR-5331

@zoldar zoldar marked this pull request as ready for review April 15, 2025 15:16
@zoldar zoldar requested review from aerosol and a team April 15, 2025 15:16
@zoldar zoldar added this pull request to the merge queue Apr 16, 2025
Merged via the queue into master with commit eb83817 Apr 16, 2025
9 checks passed
@zoldar zoldar deleted the redirect-external-to branch April 16, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants