Module: Headers

Extended by:
ActiveSupport::Concern
Included in:
ApplicationController, SignIn::ApplicationController
Defined in:
app/controllers/concerns/headers.rb

Instance Method Summary collapse

Instance Method Details

#block_unknown_hostsObject

returns a Bad Request if the incoming host header is unsafe.



9
10
11
12
# File 'app/controllers/concerns/headers.rb', line 9

def block_unknown_hosts
  return if controller_name == 'example'
  raise Common::Exceptions::NotASafeHostError, request.host unless Settings.virtual_hosts.include?(request.host)
end

#set_app_info_headersObject



14
15
16
17
# File 'app/controllers/concerns/headers.rb', line 14

def set_app_info_headers
  headers['X-Git-SHA'] = AppInfo::GIT_REVISION
  headers['X-GitHub-Repository'] = AppInfo::GITHUB_URL
end