Skip to content

Commit

Permalink
Merge pull request #141 from Crown-Commercial-Service/make-503-status…
Browse files Browse the repository at this point in the history
…-200

Make 503 status page return 200 status code so that Barracuda does not block it
  • Loading branch information
tim-s-ccs authored Nov 30, 2023
2 parents fa31ea2 + 6bf0ec7 commit 2ede85d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 36 deletions.
2 changes: 1 addition & 1 deletion app/controllers/errors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def internal_error

def service_unavailable
respond_to do |format|
format.html { render status: :service_unavailable, layout: 'error' }
format.html { render status: :ok, layout: 'error' }
end
end
end
72 changes: 38 additions & 34 deletions app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
<%= render partial: '/layouts/contact_us' %>
<%= ccs_footer(
meta: {
items: [
{
text: t('.cookie_policy_link'),
href: cookie_policy_path,
attributes: {
aria: {
label: t('.cookie_policy_link_aria_label')
items: unless current_page?(service_unavailable_path)
[
{
text: t('.cookie_policy_link'),
href: cookie_policy_path,
attributes: {
aria: {
label: t('.cookie_policy_link_aria_label')
}
}
}
},
{
text: t('.cookie_settings_link'),
href: cookie_settings_path,
attributes: {
aria: {
label: t('.cookie_settings_link_aria_label')
},
{
text: t('.cookie_settings_link'),
href: cookie_settings_path,
attributes: {
aria: {
label: t('.cookie_settings_link_aria_label')
}
}
}
},
{
text: t('.privacy_link_text'),
href: t('.privacy_link'),
attributes: {
target: '_blank',
aria: {
label: t('.privacy_link_aria_label')
},
{
text: t('.privacy_link_text'),
href: t('.privacy_link'),
attributes: {
target: '_blank',
aria: {
label: t('.privacy_link_aria_label')
}
}
}
},
{
text: t('.accessibility_statement_link'),
href: accessibility_statement_path,
attributes: {
aria: {
label: t('.accessibility_statement_link_aria_label')
},
{
text: t('.accessibility_statement_link'),
href: accessibility_statement_path,
attributes: {
aria: {
label: t('.accessibility_statement_link_aria_label')
}
}
}
}
]
]
else
[]
end
}
) %>
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@
get '/404', to: 'errors#not_found'
get '/422', to: 'errors#unacceptable'
get '/500', to: 'errors#internal_error'
get '/503', '/service-unavailable', to: 'errors#service_unavailable'
get '/service-unavailable', to: 'errors#service_unavailable'
end

0 comments on commit 2ede85d

Please sign in to comment.