Skip to content
Snippets Groups Projects
Commit 4e963fed authored by Stan Hu's avatar Stan Hu
Browse files

Merge branch 'sh-add-user-constraints' into 'master'

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

Closes #23131

See merge request !6758
parents ed2fe984 e72f2cfc
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment