Skip to content

Commit

Permalink
Merge branch 'sh-add-user-constraints' into 'master'
Browse files Browse the repository at this point in the history
Fix missing constraints causing route failures when usernames with periods are used

Closes #23131

See merge request !6758
  • Loading branch information
stanhu committed Oct 8, 2016
2 parents ed2fe98 + e72f2cf commit 4e963fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/routes/user.rb
Expand Up @@ -15,7 +15,10 @@
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
Expand Down

0 comments on commit 4e963fe

Please sign in to comment.