Fix missing constraints causing route failures when usernames with periods are used

Closes #23131
This commit is contained in:
Stan Hu 2016-10-08 09:25:06 -07:00
parent ed2fe98412
commit e72f2cfcb2
1 changed files with 4 additions and 1 deletions

View File

@ -15,7 +15,10 @@ devise_scope :user do
end
constraints(UserUrlConstrainer.new) do
scope(path: ':username', as: :user, controller: :users) do
scope(path: ':username',
as: :user,
constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ },
controller: :users) do
get '/', action: :show
end
end