Module: Headers
- Extended by:
- ActiveSupport::Concern
- Included in:
- ApplicationController, SignIn::ApplicationController
- Defined in:
- app/controllers/concerns/headers.rb
Instance Method Summary collapse
-
#block_unknown_hosts ⇒ Object
returns a Bad Request if the incoming host header is unsafe.
- #set_app_info_headers ⇒ Object
Instance Method Details
#block_unknown_hosts ⇒ Object
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_headers ⇒ Object
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 |