Skip to content

Commit 1781d5d

Browse files
committed
chore: drop glob routes from forwarding in Plug.Router
1 parent b3222a4 commit 1781d5d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/ash_json_api/controllers/router.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ defmodule AshJsonApi.Controllers.Router do
155155
|> Map.update!(:path_params, fn path_params ->
156156
path_params
157157
|> Kernel.||(%{})
158+
# Filter out glob params injected by Plug.Router's `forward` macro,
159+
# which are always lists (e.g. %{"glob" => ["path", "segments"]}).
160+
# Legitimate path params from the outer router are strings.
161+
|> Map.reject(fn {_k, v} -> is_list(v) end)
158162
|> Map.merge(params)
159163
end)
160164
|> then(fn conn ->

0 commit comments

Comments
 (0)