Class: WebConsole::WhinyRequest

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/web_console/whiny_request.rb

Overview

Noisy wrapper around Request.

If any calls to from_whitelisted_ip? and acceptable_content_type? return false, an info log message will be displayed in users’ logs.

Instance Method Summary collapse

Instance Method Details

#from_whitelisted_ip?Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/web_console/whiny_request.rb', line 7

def from_whitelisted_ip?
  whine_unless request.from_whitelisted_ip? do
    "Cannot render console from #{request.strict_remote_ip}! " \
      "Allowed networks: #{request.whitelisted_ips}"
  end
end