Skip to content

Commit

Permalink
Merge pull request #2497 from alphagov/rename-constant
Browse files Browse the repository at this point in the history
  • Loading branch information
chao-xian authored Jun 16, 2021
2 parents 7f77892 + ad9e23a commit cf74f19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/root_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class RootController < ApplicationController

caches_page :template

NON_LAYOUT_TEMPLATES = %w[
TEMPLATES = %w[
400
401
403
Expand All @@ -31,7 +31,7 @@ class RootController < ApplicationController
].freeze

def template
if NON_LAYOUT_TEMPLATES.include?(params[:template])
if TEMPLATES.include?(params[:template])
render action: params[:template]
else
render action: params[:template], layout: "govuk_template"
Expand All @@ -42,7 +42,7 @@ def template

def validate_template_param
# Allow alphanumeric and _ in template filenames.
# Prevent any attempts to traverse directores etc...
# Prevent any attempts to traverse directories etc...
unless params[:template].match?(/\A\w+\z/)
error_404
end
Expand Down

0 comments on commit cf74f19

Please sign in to comment.