Skip to content

Commit

Permalink
using Path.join/1 to prevent double / issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cblavier committed Oct 26, 2023
1 parent 17daa01 commit 67f36e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/phoenix/live_dashboard/layout_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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}"])
)
else
apply(
Expand Down
4 changes: 2 additions & 2 deletions lib/phoenix/live_dashboard/page_builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -982,9 +982,9 @@ defmodule Phoenix.LiveDashboard.PageBuilder do

path =
if node == node() and is_nil(old_params["node"]) do
"#{prefix}/#{route}"
Path.join([prefix, to_string(route)])
else
"#{prefix}/#{URI.encode_www_form(to_string(node))}/#{route}"
Path.join([prefix, URI.encode_www_form(to_string(node)), to_string(route)])
end

Phoenix.VerifiedRoutes.unverified_path(socket, socket.router, path, new_params)
Expand Down

0 comments on commit 67f36e1

Please sign in to comment.