Skip to content
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

Using Path.join/1 to prevent double-slash issues #430

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

cblavier
Copy link
Contributor

Fixes #429

I had a look in page_builder_test.exs but could not see any path-related tests, so I carefully didn't take any initiative ;-)

@@ -27,7 +27,7 @@ defmodule Phoenix.LiveDashboard.LayoutView do
Phoenix.VerifiedRoutes.unverified_path(
conn,
conn.private.phoenix_router,
"#{prefix}/#{asset}-#{hash}"
Path.join([prefix, "#{asset}-#{hash}"])
Copy link
Member

Choose a reason for hiding this comment

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

This may use \ on Windows. We would probably need to check the prefix explicitly. Perhaps we should rather normalize __live_dashboard_prefix__ to return "" as the prefix when mounted on root?

@josevalim josevalim merged commit adb5e38 into phoenixframework:main Oct 26, 2023
3 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when mounting the dashboard on "/"
2 participants