Skip to content

Commit

Permalink
Fix regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien1018 committed Oct 29, 2023
1 parent cb3171a commit 0355b21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def configure_permitted_parameters
end

def set_layout_and_contest
if /^\/contests\/./.match(request.fullpath) && !/^\/contests\/new\/?/.match(request.fullpath)
if /^\/contests\/./.match(request.fullpath) && !/^\/contests\/new(\/|$)/.match(request.fullpath)
# Use arbitrary character here instead of [0-9] to give proper 404 to requests such as /contests/abcde
# However, we need to exclude /contests/new
@layout = :contest
Expand Down

0 comments on commit 0355b21

Please sign in to comment.