-
Notifications
You must be signed in to change notification settings - Fork 137
Expand file tree
/
Copy pathsnoop_controller.rb
More file actions
37 lines (33 loc) · 1.12 KB
/
snoop_controller.rb
File metadata and controls
37 lines (33 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class SnoopController < ApplicationController
def index
@snoop = {}
@snoop[:env] = request.env
@snoop[:remote_addr] = request.remote_addr
@snoop[:remote_ip] = request.remote_ip
@snoop[:host_with_port] = request.host_with_port
@snoop[:path] = request.path
@snoop[:server_software] = request.server_software
@snoop[:cookies] = request.cookies
@snoop[:session_options] = request.session_options
@snoop[:session] = request.session.inspect
@snoop[:middleware] = Rails.configuration.middleware.map(&:inspect)
@snoop[:load_path] = $LOAD_PATH
@snoop[:system_properties] = Hash[*Java::JavaLang::System.getProperties.to_a.flatten] if defined?(JRUBY_VERSION)
end
def hello
forward_to "/hello?from+SnoopController"
end
def session_form
session[:id]
@session_hash = session.to_hash
end
def session_edit
if request.post?
session[params[:key]] = params[:value] if params[:key]
end
redirect_to :action => "session_form"
end
def error
raise "you requested an error"
end
end