elixir-plug / plug

Compose web applications with functions
https://hex.pm/packages/plug
Other
2.87k stars 586 forks source link

Fix route matching for components with numbers #1068

Closed moogle19 closed 2 years ago

moogle19 commented 2 years ago

Since 1.13.0 the matching with routes that contain numbers would fail with:

** (Plug.Router.InvalidSpecError) invalid dynamic path. Only letters, numbers, and underscore are allowed after : in "foo/:user1" 
    (plug 1.13.2) lib/plug/router/utils.ex:89: Plug.Router.Utils.build_path_match/2

This PR fixes the problem and adds tests for dynamic paths.

josevalim commented 2 years ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart: