http.rb
rescue in block in connect
/usr/lib/ruby/2.4.0/net/http.rb
in
rescue in block in connect
end
D "opening connection to #{conn_address}:#{conn_port}..."
s = Timeout.timeout(@open_timeout, Net::OpenTimeout) {
begin
TCPSocket.open(conn_address, conn_port, @local_host, @local_port)
rescue => e
raise e, "Failed to open TCP connection to " +
"#{conn_address}:#{conn_port} (#{e.message})"
end
}
s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
D "opened"
if use_ssl?
if proxy?
/usr/lib/ruby/2.4.0/net/http.rb
in
block in connect
else
conn_address = address
conn_port = port
end
D "opening connection to #{conn_address}:#{conn_port}..."
s = Timeout.timeout(@open_timeout, Net::OpenTimeout) {
begin
TCPSocket.open(conn_address, conn_port, @local_host, @local_port)
rescue => e
raise e, "Failed to open TCP connection to " +
"#{conn_address}:#{conn_port} (#{e.message})"
end
}
s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
/usr/lib/ruby/2.4.0/timeout.rb
in
block in timeout
sleep sec
rescue => e
x.raise e
else
x.raise exception, message
end
}
return yield(sec)
ensure
if y
y.kill
y.join # make sure y is dead.
end
end
end
/usr/lib/ruby/2.4.0/timeout.rb
in
timeout
y.kill
y.join # make sure y is dead.
end
end
end
if klass
begin
bl.call(klass)
rescue klass => e
bt = e.backtrace
end
else
bt = Error.catch(message, &bl)
end
level = -caller(CALLER_OFFSET).size-2
/usr/lib/ruby/2.4.0/net/http.rb
in
connect
conn_port = proxy_port
else
conn_address = address
conn_port = port
end
D "opening connection to #{conn_address}:#{conn_port}..."
s = Timeout.timeout(@open_timeout, Net::OpenTimeout) {
begin
TCPSocket.open(conn_address, conn_port, @local_host, @local_port)
rescue => e
raise e, "Failed to open TCP connection to " +
"#{conn_address}:#{conn_port} (#{e.message})"
end
}
/usr/lib/ruby/2.4.0/net/http.rb
in
do_start
end
end
do_start
self
end
def do_start
connect
@started = true
end
private :do_start
def connect
if proxy? then
conn_address = proxy_address
/usr/lib/ruby/2.4.0/net/http.rb
in
start
# When called with a block, it returns the return value of the
# block; otherwise, it returns self.
#
def start # :yield: http
raise IOError, 'HTTP session already opened' if @started
if block_given?
begin
do_start
return yield(self)
ensure
do_finish
end
end
do_start
self
/var/lib/gems/2.4.0/gems/httpi-2.4.3/lib/httpi/adapter/net_http.rb
in
do_request
proxy = Net::HTTP::Proxy(proxy_url.host, proxy_url.port, proxy_url.user, proxy_url.password)
end
proxy.new(@request.url.host, @request.url.port)
end
def do_request(type, &requester)
setup
response = @client.start do |http|
negotiate_ntlm_auth(http, &requester) if @request.auth.ntlm?
requester.call(http, request_client(type))
end
respond_with(response)
end
def setup
/var/lib/gems/2.4.0/gems/httpi-2.4.3/lib/httpi/adapter/net_http.rb
in
request
# Determine if Net::HTTP supports the method using reflection
unless Net::HTTP.const_defined?(:"#{method.to_s.capitalize}") &&
Net::HTTP.const_get(:"#{method.to_s.capitalize}").class == Class
raise NotSupportedError, "Net::HTTP does not support "\
"#{method.to_s.upcase}"
end
do_request(method) do |http, http_request|
http_request.body = @request.body
if @request.on_body then
perform(http, http_request) do |res|
res.read_body do |seg|
@request.on_body.call(seg)
end
end
/var/lib/gems/2.4.0/gems/httpi-2.4.3/lib/httpi.rb
in
request
# Executes an HTTP request for the given +method+.
def request(method, request, adapter = nil, redirects = 0)
adapter_class = load_adapter(adapter, request)
yield adapter_class.client if block_given?
log_request(method, request, Adapter.identify(adapter_class.class))
response = adapter_class.request(method)
if response && HTTPI::Response::RedirectResponseCodes.member?(response.code) && request.follow_redirect? && redirects < request.redirect_limit
request.url = URI.join(request.url, response.headers['location'])
log("Following redirect: '#{request.url}'.")
return request(method, request, adapter, redirects + 1)
end
/var/lib/gems/2.4.0/gems/httpi-2.4.3/lib/httpi.rb
in
get
end
@query_builder = builder
end
# Executes an HTTP GET request.
def get(request, adapter = nil, &block)
request = Request.new(request) if request.kind_of? String
request(:get, request, adapter, &block)
end
# Executes an HTTP POST request.
def post(*args, &block)
request, adapter = request_and_adapter_from(args)
request(:post, request, adapter, &block)
end
/var/lib/gems/2.4.0/gems/wasabi-3.5.0/lib/wasabi/resolver.rb
in
load_from_remote
end
end
private
def load_from_remote
request.url = document
response = HTTPI.get(request, adapter)
raise HTTPError.new("Error: #{response.code} for url #{request.url}", response) if response.error?
response.body
end
def load_from_disc
/var/lib/gems/2.4.0/gems/wasabi-3.5.0/lib/wasabi/resolver.rb
in
resolve
attr_reader :document, :request, :adapter
def resolve
raise ArgumentError, "Unable to resolve: #{document.inspect}" unless document
case document
when URL then load_from_remote
when XML then document
else load_from_disc
end
end
private
/var/lib/gems/2.4.0/gems/wasabi-3.5.0/lib/wasabi/document.rb
in
xml
uri = parser.namespaces[namespace]
!(uri =~ %r{^http://schemas.xmlsoap.org} || uri =~ %r{^http://www.w3.org})
end
# Returns the raw WSDL document.
# Can be used as a hook to extend the library.
def xml
@xml ||= Resolver.new(document, request, adapter).resolve
end
# Parses the WSDL document and returns the <tt>Wasabi::Parser</tt>.
def parser
@parser ||= guard_parse && parse
end
/var/lib/gems/2.4.0/gems/wasabi-3.5.0/lib/wasabi/document.rb
in
parse
def guard_parse
return true if document
raise ArgumentError, "Wasabi needs a WSDL document"
end
# Parses the WSDL document and returns <tt>Wasabi::Parser</tt>.
def parse
parser = Parser.new Nokogiri::XML(xml)
parser.parse
parser
end
def element_keys(info)
info.keys - [:namespace, :order!, :base_type]
end
/var/lib/gems/2.4.0/gems/wasabi-3.5.0/lib/wasabi/document.rb
in
parser
# Can be used as a hook to extend the library.
def xml
@xml ||= Resolver.new(document, request, adapter).resolve
end
# Parses the WSDL document and returns the <tt>Wasabi::Parser</tt>.
def parser
@parser ||= guard_parse && parse
end
private
# Raises an error if the WSDL document is missing.
def guard_parse
return true if document
/var/lib/gems/2.4.0/gems/wasabi-3.5.0/lib/wasabi/document.rb
in
soap_actions
def element_form_default=(value)
self.class.validate_element_form_default!(value)
@element_form_default = value
end
# Returns a list of available SOAP actions.
def soap_actions
@soap_actions ||= parser.operations.keys
end
# Returns the SOAP action for a given +key+.
def soap_action(key)
operations[key][:action] if operations[key]
end
/var/lib/gems/2.4.0/gems/savon-2.12.0/lib/savon/operation.rb
in
ensure_exists!
ensure_exists! operation_name, wsdl
end
new(operation_name, wsdl, globals)
end
def self.ensure_exists!(operation_name, wsdl)
unless wsdl.soap_actions.include? operation_name
raise UnknownOperationError, "Unable to find SOAP operation: #{operation_name.inspect}\n" \
"Operations provided by your service: #{wsdl.soap_actions.inspect}"
end
rescue Wasabi::Resolver::HTTPError => e
raise HTTPError.new(e.response)
end
/var/lib/gems/2.4.0/gems/savon-2.12.0/lib/savon/operation.rb
in
create
module Savon
class Operation
def self.create(operation_name, wsdl, globals)
if wsdl.document?
ensure_name_is_symbol! operation_name
ensure_exists! operation_name, wsdl
end
new(operation_name, wsdl, globals)
end
def self.ensure_exists!(operation_name, wsdl)
unless wsdl.soap_actions.include? operation_name
/var/lib/gems/2.4.0/gems/savon-2.12.0/lib/savon/client.rb
in
operation
def operations
raise_missing_wsdl_error! unless @wsdl.document?
@wsdl.soap_actions
end
def operation(operation_name)
Operation.create(operation_name, @wsdl, @globals)
end
def call(operation_name, locals = {}, &block)
operation(operation_name).call(locals, &block)
end
def service_name
/var/lib/gems/2.4.0/gems/savon-2.12.0/lib/savon/client.rb
in
call
end
def operation(operation_name)
Operation.create(operation_name, @wsdl, @globals)
end
def call(operation_name, locals = {}, &block)
operation(operation_name).call(locals, &block)
end
def service_name
raise_missing_wsdl_error! unless @wsdl.document?
@wsdl.service_name
end
/home/su207/decuong-ubuntu/lib/user_service.rb
in
get_mon
res_hash = response.body.to_hash
ls = res_hash[:cau_hinh_mon_hoc_list_by_email_response][:cau_hinh_mon_hoc_list_by_email_result][:diffgram][:document_element]
return nil unless ls
return ls[:cau_hinh_mon_hoc]
end
def get_mon(ma_mon_hoc)
# CauHinhMonHoc_GetByMaMonHoc
response = @client.call(:cau_hinh_mon_hoc_get_by_ma_mon_hoc, message: {ma_mon_hoc: ma_mon_hoc})
res_hash = response.body.to_hash
ls = res_hash[:cau_hinh_mon_hoc_get_by_ma_mon_hoc_response][:cau_hinh_mon_hoc_get_by_ma_mon_hoc_result][:diffgram][:document_element]
return ls[:cau_hinh_mon_hoc]
end
def update(message)
response = @client.call(:cau_hinh_mon_hoc_update, message: message)
res_hash = response.body.to_hash
/home/su207/decuong-ubuntu/controllers/main_controller.rb
in
block in <class:MainController>
@danh_sach_mons = user_service.load_email(user.username)
erb :index, :layout => :application
end
get "/show/:ma_mon_hoc" do
@ma_mon_hoc = params[:ma_mon_hoc]
@mon = Mon.where(ma_mon_hoc: @ma_mon_hoc).first_or_create!
@res = user_service.get_mon(@ma_mon_hoc)
@loai_mon_hoc = @res[:loai_mon_hoc] || "Lý thuyết"
@hinh_thuc_thi = @res[:hinh_thuc_thi] || "B.Vệ"
@de_cuong_xay_dung_theo_huong = @res[:de_cuong_xay_dung_theo_huong] || "Bộ GDĐT"
erb :show, :layout => :application
end
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
call
pattern = compile(path, route_mustermann_opts)
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
conditions, @conditions = @conditions, []
wrapper = block.arity != 0 ?
proc { |a, p| unbound_method.bind(a).call(*p) } :
proc { |a, p| unbound_method.bind(a).call }
[ pattern, conditions, wrapper ]
end
def compile(path, route_mustermann_opts = {})
Mustermann.new(path, mustermann_opts.merge(route_mustermann_opts))
end
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
block in compile!
pattern = compile(path, route_mustermann_opts)
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
conditions, @conditions = @conditions, []
wrapper = block.arity != 0 ?
proc { |a, p| unbound_method.bind(a).call(*p) } :
proc { |a, p| unbound_method.bind(a).call }
[ pattern, conditions, wrapper ]
end
def compile(path, route_mustermann_opts = {})
Mustermann.new(path, mustermann_opts.merge(route_mustermann_opts))
end
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
block (3 levels) in route!
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, conditions, block|
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
end
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
route_eval
route_eval(&pass_block) if pass_block
route_missing
end
# Run a route block and throw :halt with the result.
def route_eval
throw :halt, yield
end
# If the current request matches pattern and conditions, fill params
# with keys and call the given block.
# Revert params afterwards.
#
# Returns pass block.
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
block (2 levels) in route!
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, conditions, block|
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
end
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
block in process_route
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
rescue
@env['sinatra.error.params'] = @params
raise
ensure
@params = original if original
end
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
catch
captures = pattern.match(route).captures
values += captures
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
rescue
@env['sinatra.error.params'] = @params
raise
ensure
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
process_route
captures = pattern.match(route).captures
values += captures
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
rescue
@env['sinatra.error.params'] = @params
raise
ensure
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
block in route!
base.filters[type].each { |args| process_route(*args) }
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, conditions, block|
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
each
filter! type, base.superclass if base.superclass.respond_to?(:filters)
base.filters[type].each { |args| process_route(*args) }
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, conditions, block|
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
route!
filter! type, base.superclass if base.superclass.respond_to?(:filters)
base.filters[type].each { |args| process_route(*args) }
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, conditions, block|
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
block in dispatch!
# Dispatch a request with error handling.
def dispatch!
force_encoding(@params.merge!(@request.params))
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before
route!
end
rescue ::Exception => boom
invoke { handle_exception!(boom) }
ensure
begin
filter! :after unless env['sinatra.static_file']
rescue ::Exception => boom
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
block in invoke
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(:disposition => nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
catch
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(:disposition => nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
invoke
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(:disposition => nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
dispatch!
nil # avoid double setting the same response tuple twice
end
# Dispatch a request with error handling.
def dispatch!
force_encoding(@params.merge!(@request.params))
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before
route!
end
rescue ::Exception => boom
invoke { handle_exception!(boom) }
ensure
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
block in call!
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
template_cache.clear if settings.reload_templates
@response['Content-Type'] = nil
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
unless @response['Content-Type']
if Array === body and body[0].respond_to? :content_type
content_type body[0].content_type
else
content_type :html
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
block in invoke
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(:disposition => nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
catch
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(:disposition => nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
invoke
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(:disposition => nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
call!
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
template_cache.clear if settings.reload_templates
@response['Content-Type'] = nil
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
unless @response['Content-Type']
if Array === body and body[0].respond_to? :content_type
content_type body[0].content_type
else
content_type :html
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
call
@app = app
@template_cache = Tilt::Cache.new
yield self if block_given?
end
# Rack call interface.
def call(env)
dup.call!(env)
end
def call!(env) # :nodoc:
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
/var/lib/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/xss_header.rb
in
call
#
# Options:
# xss_mode:: How the browser should prevent the attack (default: :block)
class XSSHeader < Base
default_options :xss_mode => :block, :nosniff => true
def call(env)
status, headers, body = @app.call(env)
headers['X-XSS-Protection'] ||= "1; mode=#{options[:xss_mode]}" if html? headers
headers['X-Content-Type-Options'] ||= 'nosniff' if options[:nosniff]
[status, headers, body]
end
end
end
end
/var/lib/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if Array === result and result.size == 3
end
/var/lib/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if Array === result and result.size == 3
end
/var/lib/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/path_traversal.rb
in
call
#
# Unescapes '/' and '.', expands +path_info+.
# Thus <tt>GET /foo/%2e%2e%2fbar</tt> becomes <tt>GET /bar</tt>.
class PathTraversal < Base
def call(env)
path_was = env["PATH_INFO"]
env["PATH_INFO"] = cleanup path_was if path_was && !path_was.empty?
app.call env
ensure
env["PATH_INFO"] = path_was
end
def cleanup(path)
if path.respond_to?(:encoding)
# Ruby 1.9+ M17N
/var/lib/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/json_csrf.rb
in
call
class JsonCsrf < Base
default_options :allow_if => nil
alias react deny
def call(env)
request = Request.new(env)
status, headers, body = app.call(env)
if has_vector?(request, headers)
warn env, "attack prevented by #{self.class}"
react_and_close(env, body) or [status, headers, body]
else
[status, headers, body]
/var/lib/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if Array === result and result.size == 3
end
/var/lib/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if Array === result and result.size == 3
end
/var/lib/gems/2.4.0/gems/rack-protection-2.0.3/lib/rack/protection/frame_options.rb
in
call
frame_options = options[:frame_options]
frame_options = options[:frame_options].to_s.upcase unless frame_options.respond_to? :to_str
frame_options.to_str
end
end
def call(env)
status, headers, body = @app.call(env)
headers['X-Frame-Options'] ||= frame_options if html? headers
[status, headers, body]
end
end
end
end
/var/lib/gems/2.4.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb
in
context
def call(env)
context(env)
end
def context(env, app=@app)
req = make_request env
prepare_session(req)
status, headers, body = app.call(req.env)
res = Rack::Response::Raw.new status, headers
commit_session(req, res)
[status, headers, body]
end
private
/var/lib/gems/2.4.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb
in
call
@default_options = self.class::DEFAULT_OPTIONS.merge(options)
@key = @default_options.delete(:key)
@cookie_only = @default_options.delete(:cookie_only)
initialize_sid
end
def call(env)
context(env)
end
def context(env, app=@app)
req = make_request env
prepare_session(req)
status, headers, body = app.call(req.env)
res = Rack::Response::Raw.new status, headers
/var/lib/gems/2.4.0/gems/rack-2.0.5/lib/rack/null_logger.rb
in
call
class NullLogger
def initialize(app)
@app = app
end
def call(env)
env[RACK_LOGGER] = self
@app.call(env)
end
def info(progname = nil, &block); end
def debug(progname = nil, &block); end
def warn(progname = nil, &block); end
def error(progname = nil, &block); end
def fatal(progname = nil, &block); end
/var/lib/gems/2.4.0/gems/rack-2.0.5/lib/rack/head.rb
in
call
# all other requests unchanged.
class Head
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
if env[REQUEST_METHOD] == HEAD
[
status, headers, Rack::BodyProxy.new([]) do
body.close if body.respond_to? :close
end
]
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/show_exceptions.rb
in
call
def @@eats_errors.puts(*) end
def initialize(app)
@app = app
end
def call(env)
@app.call(env)
rescue Exception => e
errors, env["rack.errors"] = env["rack.errors"], @@eats_errors
if prefers_plain_text?(env)
content_type = "text/plain"
body = dump_exception(e)
else
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
call
# Some Rack handlers (Thin, Rainbows!) implement an extended body object protocol, however,
# some middleware (namely Rack::Lint) will break it by not mirroring the methods in question.
# This middleware will detect an extended body object and will make sure it reaches the
# handler directly. We do this here, so our middleware and middleware set up by the app will
# still be able to run.
class ExtendedRack < Struct.new(:app)
def call(env)
result, callback = app.call(env), env['async.callback']
return result unless callback and async?(*result)
after_response { callback.call result }
setup_close(env, *result)
throw :async
end
private
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
call
end
def helpers
@instance
end
def call(env)
@stack.call(env)
end
def inspect
"#<#{@instance.class} app_file=#{settings.app_file.inspect}>"
end
end
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
block in call
setup_default_middleware builder
setup_middleware builder
builder.run app
builder
end
def call(env)
synchronize { prototype.call(env) }
end
# Like Kernel#caller but excluding certain magic entries and without
# line / method information; the resulting array contains filenames only.
def caller_files
cleaned_caller(1).flatten
end
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
synchronize
end
@@mutex = Mutex.new
def synchronize(&block)
if lock?
@@mutex.synchronize(&block)
else
yield
end
end
# used for deprecation warnings
def warn(message)
super message + "\n\tfrom #{cleaned_caller.first.join(':')}"
end
/var/lib/gems/2.4.0/gems/sinatra-2.0.3/lib/sinatra/base.rb
in
call
setup_default_middleware builder
setup_middleware builder
builder.run app
builder
end
def call(env)
synchronize { prototype.call(env) }
end
# Like Kernel#caller but excluding certain magic entries and without
# line / method information; the resulting array contains filenames only.
def caller_files
cleaned_caller(1).flatten
end
/var/lib/gems/2.4.0/gems/rack-2.0.5/lib/rack/urlmap.rb
in
block in call
rest = m[1]
next unless !rest || rest.empty? || rest[0] == ?/
env[SCRIPT_NAME] = (script_name + location)
env[PATH_INFO] = rest
return app.call(env)
end
[404, {CONTENT_TYPE => "text/plain", "X-Cascade" => "pass"}, ["Not Found: #{path}"]]
ensure
env[PATH_INFO] = path
env[SCRIPT_NAME] = script_name
/var/lib/gems/2.4.0/gems/rack-2.0.5/lib/rack/urlmap.rb
in
each
http_host = env[HTTP_HOST]
server_name = env[SERVER_NAME]
server_port = env[SERVER_PORT]
is_same_server = casecmp?(http_host, server_name) ||
casecmp?(http_host, "#{server_name}:#{server_port}")
@mapping.each do |host, location, match, app|
unless casecmp?(http_host, host) \
|| casecmp?(server_name, host) \
|| (!host && is_same_server)
next
end
next unless m = match.match(path.to_s)
/var/lib/gems/2.4.0/gems/rack-2.0.5/lib/rack/urlmap.rb
in
call
http_host = env[HTTP_HOST]
server_name = env[SERVER_NAME]
server_port = env[SERVER_PORT]
is_same_server = casecmp?(http_host, server_name) ||
casecmp?(http_host, "#{server_name}:#{server_port}")
@mapping.each do |host, location, match, app|
unless casecmp?(http_host, host) \
|| casecmp?(server_name, host) \
|| (!host && is_same_server)
next
end
next unless m = match.match(path.to_s)
/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/connection.rb
in
block in pre_process
# When we're under a non-async framework like rails, we can still spawn
# off async responses using the callback info, so there's little point
# in removing this.
response = AsyncResponse
catch(:async) do
# Process the request calling the Rack adapter
response = @app.call(@request.env)
end
response
rescue Exception => e
unexpected_error(e)
# Pass through error response
can_persist? && @request.persistent? ? Response::PERSISTENT_ERROR : Response::ERROR
end
/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/connection.rb
in
catch
end
end
# When we're under a non-async framework like rails, we can still spawn
# off async responses using the callback info, so there's little point
# in removing this.
response = AsyncResponse
catch(:async) do
# Process the request calling the Rack adapter
response = @app.call(@request.env)
end
response
rescue Exception => e
unexpected_error(e)
# Pass through error response
/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/connection.rb
in
pre_process
end
end
# When we're under a non-async framework like rails, we can still spawn
# off async responses using the callback info, so there's little point
# in removing this.
response = AsyncResponse
catch(:async) do
# Process the request calling the Rack adapter
response = @app.call(@request.env)
end
response
rescue Exception => e
unexpected_error(e)
# Pass through error response
/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/connection.rb
in
process
# is ready to be processed.
def process
if threaded?
@request.threaded = true
EventMachine.defer { post_process(pre_process) }
else
@request.threaded = false
post_process(pre_process)
end
end
def ssl_verify_peer(cert)
# In order to make the cert available later we have to have made at least
# a show of verifying it.
true
/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/connection.rb
in
receive_data
@response = Response.new
end
# Called when data is received from the client.
def receive_data(data)
@idle = false
trace data
process if @request.parse(data)
rescue InvalidRequest => e
log_error("Invalid request", e)
post_process Response::BAD_REQUEST
end
# Called when all data was received and the request
# is ready to be processed.
/var/lib/gems/2.4.0/gems/eventmachine-1.2.7/lib/eventmachine.rb
in
run_machine
end
# Rubinius needs to come back into "Ruby space" for GC to work,
# so we'll crank the machine here.
if defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
while run_machine_once; end
else
run_machine
end
ensure
until @tails.empty?
@tails.pop.call
end
/var/lib/gems/2.4.0/gems/eventmachine-1.2.7/lib/eventmachine.rb
in
run
end
# Rubinius needs to come back into "Ruby space" for GC to work,
# so we'll crank the machine here.
if defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
while run_machine_once; end
else
run_machine
end
ensure
until @tails.empty?
@tails.pop.call
end
/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/backends/base.rb
in
start
end
# Allow for early run up of eventmachine.
if EventMachine.reactor_running?
starter.call
else
@started_reactor = true
EventMachine.run(&starter)
end
end
# Stop of the backend from accepting new connections.
def stop
@running = false
@stopping = true
/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/server.rb
in
start
log_info "Thin web server (v#{VERSION::STRING} codename #{VERSION::CODENAME})"
log_debug "Debugging ON"
trace "Tracing ON"
log_info "Maximum connections set to #{@backend.maximum_connections}"
log_info "Listening on #{@backend}, CTRL+C to stop"
@backend.start { setup_signals if @setup_signals }
end
alias :start! :start
# == Gracefull shutdown
# Stops the server after processing all current connections.
# As soon as this method is called, the server stops accepting
# new requests and waits for all current connections to finish.
/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/controllers/controller.rb
in
start
# If a stats URL is specified, wrap in Stats adapter
server.app = Stats::Adapter.new(server.app, @options[:stats]) if @options[:stats]
# Register restart procedure which just start another process with same options,
# so that's why this is done here.
server.on_restart { Command.run(:start, @options) }
server.start
end
def stop
raise OptionRequired, :pid unless @options[:pid]
tail_log(@options[:log]) do
if Server.kill(@options[:pid], @options[:force] ? 0 : (@options[:timeout] || 60))
/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/runner.rb
in
run_command
when cluster? then Controllers::Cluster.new(@options)
when service? then Controllers::Service.new(@options)
else Controllers::Controller.new(@options)
end
if controller.respond_to?(@command)
begin
controller.send(@command, *@arguments)
rescue RunnerError => e
abort e.message
end
else
abort "Invalid options for command: #{@command}"
end
end
/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/runner.rb
in
run!
@arguments = @argv
end
# Parse the current shell arguments and run the command.
# Exits on error.
def run!
if self.class.commands.include?(@command)
run_command
elsif @command.nil?
puts "Command required"
puts @parser
exit 1
else
abort "Unknown command: #{@command}. Use one of #{self.class.commands.join(', ')}"
end
/var/lib/gems/2.4.0/gems/thin-1.7.2/bin/thin
in
<top (required)>
#!/usr/bin/env ruby
# Thin command line interface script.
# Run <tt>thin -h</tt> to get more usage.
require 'thin'
Thin::Runner.new(ARGV).run!
/usr/local/bin/thin
in
load
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('thin', 'thin', version)
else
gem "thin", version
load Gem.bin_path("thin", "thin", version)
end
/usr/local/bin/thin
in
<main>
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('thin', 'thin', version)
else
gem "thin", version
load Gem.bin_path("thin", "thin", version)
end
No GET data.
No POST data.
Variable | Value |
---|---|
GATEWAY_INTERFACE | CGI/1.2 |
HTTP_ACCEPT | */* |
HTTP_CONNECTION | close |
HTTP_HOST | localhost:8181 |
HTTP_REFERER | http://decuong.hpu.edu.vn/show/HCM31031 |
HTTP_USER_AGENT | claudebot |
HTTP_VERSION | HTTP/1.0 |
HTTP_X_FORWARDED_FOR | 3.233.221.42 |
HTTP_X_FORWARDED_HOST | decuong.hpu.edu.vn |
HTTP_X_FORWARDED_SERVER | decuong.hpu.edu.vn |
PATH_INFO | /show/HCM31031 |
QUERY_STRING | |
REMOTE_ADDR | 127.0.0.1 |
REQUEST_METHOD | GET |
REQUEST_PATH | /show/HCM31031 |
REQUEST_URI | /show/HCM31031 |
SCRIPT_NAME | |
SERVER_NAME | localhost |
SERVER_PORT | 8181 |
SERVER_PROTOCOL | HTTP/1.1 |
SERVER_SOFTWARE | thin 1.7.2 codename Bachmanity |
async.callback | #<Method: #<Thin::Connection:0x00000000063166f8 @signature=6275076, @request=#<Thin::Request:0x0000000006316630 @parser=#<Thin::HttpParser:0x0000000006316608>, @data=nil, @nparsed=268, @body=#<StringIO:0x0000000006316590>, @env={"SERVER_SOFTWARE"=>"thin 1.7.2 codename Bachmanity", "SERVER_NAME"=>"localhost", "rack.input"=>#<StringIO:0x0000000006316590>, "rack.version"=>[1, 0], "rack.errors"=>#<Object:0x000000000284a7e0>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "REQUEST_METHOD"=>"GET", "REQUEST_PATH"=>"/show/HCM31031", "PATH_INFO"=>"/show/HCM31031", "REQUEST_URI"=>"/show/HCM31031", "HTTP_VERSION"=>"HTTP/1.0", "HTTP_X_FORWARDED_HOST"=>"decuong.hpu.edu.vn", "HTTP_X_FORWARDED_SERVER"=>"decuong.hpu.edu.vn", "HTTP_X_FORWARDED_FOR"=>"3.233.221.42", "HTTP_HOST"=>"localhost:8181", "HTTP_CONNECTION"=>"close", "HTTP_ACCEPT"=>"*/*", "HTTP_USER_AGENT"=>"claudebot", "HTTP_REFERER"=>"http://decuong.hpu.edu.vn/show/HCM31031", "GATEWAY_INTERFACE"=>"CGI/1.2", "SERVER_PORT"=>"8181", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "rack.url_scheme"=>"http", "SCRIPT_NAME"=>"", "REMOTE_ADDR"=>"127.0.0.1", "async.callback"=>#<Method: #<Thin::Connection:0x00000000063166f8 ...>.post_process>, "async.close"=>#<EventMachine::DefaultDeferrable:0x0000000006315f28>, "rack.logger"=>#<Rack::NullLogger:0x0000000004727f50 @app=#<Rack::Session::Cookie:0x0000000002fc8788 @secrets=["e352c0834ef51dcc184de5c2ac01e2ed1c92560c62773d5320b2554967557035a6935134b0414dd84af90394648d1ccb1d30e2593a3ad525c2955e16d27e8937"], @hmac=OpenSSL::Digest::SHA1, @coder=#<Rack::Session::Cookie::Base64::Marshal:0x0000000002fc8148>, @app=#<Rack::Protection::FrameOptions:0x0000000002fc9228 @app=#<Rack::Protection::HttpOrigin:0x0000000002fca358 @app=#<Rack::Protection::IPSpoofing:0x0000000002fca8d0 @app=#<Rack::Protection::JsonCsrf:0x0000000002fcb230 @app=#<Rack::Protection::PathTraversal:0x0000000002fcb8c0 @app=#<Rack::Protection::RemoteToken:0x0000000004720020 @app=#<Rack::Protection::SessionHijacking:0x0000000004720110 @app=#<Rack::Protection::XSSHeader:0x0000000004720200 @app=#<MainController:0x00000000046bd6f0 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Tilt::Cache:0x00000000046bd6a0 @cache={}>>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :xss_mode=>:block, :nosniff=>true, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :tracking_key=>:tracking, :encrypt_tracking=>true, :track=>["HTTP_USER_AGENT", "HTTP_ACCEPT_LANGUAGE"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :authenticity_param=>"authenticity_token", :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :frame_options=>:sameorigin, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}, @frame_options="SAMEORIGIN">, @default_options={:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :sidbits=>128, :secure_random=>SecureRandom, :secret=>"e352c0834ef51dcc184de5c2ac01e2ed1c92560c62773d5320b2554967557035a6935134b0414dd84af90394648d1ccb1d30e2593a3ad525c2955e16d27e8937", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0x0000000002fc8148>}, @key="rack.session", @cookie_only=true, @sidbits=128, @sid_secure=SecureRandom, @sid_length=32>>, "rack.session"=>{"session_id"=>"28d09a2797c58e689b9cda727191f352d5ef9718055f1459a2d268b9ad0b59c9", "csrf"=>"8xFtUB2m9FH8w08D7jRV6ChWejl4vuKuIea3TKDLEBw=", "tracking"=>{"HTTP_USER_AGENT"=>"ec0660ee20674482e3fbf9df2da732a482688d77", "HTTP_ACCEPT_LANGUAGE"=>"da39a3ee5e6b4b0d3255bfef95601890afd80709"}}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :sidbits=>128, :secure_random=>SecureRandom, :secret=>"e352c0834ef51dcc184de5c2ac01e2ed1c92560c62773d5320b2554967557035a6935134b0414dd84af90394648d1ccb1d30e2593a3ad525c2955e16d27e8937", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0x0000000002fc8148>}, "rack.request.cookie_hash"=>{}, "rack.session.unpacked_cookie_data"=>{"session_id"=>"28d09a2797c58e689b9cda727191f352d5ef9718055f1459a2d268b9ad0b59c9"}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "sinatra.route"=>"GET /show/:ma_mon_hoc", "sinatra.error.params"=>{"ma_mon_hoc"=>"HCM31031"}, "sinatra.error"=>#<Errno::EHOSTUNREACH: Failed to open TCP connection to 10.1.0.236:8088 (No route to host - connect(2) for "10.1.0.236" port 8088)>, "sinatra.accept"=>[#<Sinatra::Request::AcceptEntry:0x000000000630c248 @entry="*/*", @type="*/*", @params={}, @q=1.0>]}>, @response=#<Thin::Response:0x0000000006316540 @headers=#<Thin::Headers:0x0000000006316518 @sent={}, @out=[]>, @status=200, @persistent=false, @skip_body=false>, @backend=#<Thin::Backends::TcpServer:0x000000000220e9f8 @host="0.0.0.0", @port=8181, @connections={51950460=>#<Thin::Connection:0x00000000063166f8 ...>}, @timeout=30, @persistent_connection_count=1, @maximum_connections=1024, @maximum_persistent_connections=100, @no_epoll=nil, @ssl=nil, @threaded=nil, @started_reactor=true, @server=#<Thin::Server:0x0000000002220130 @tag=nil, @backend=#<Thin::Backends::TcpServer:0x000000000220e9f8 ...>, @setup_signals=true, @pid_file="tmp/pids/thin.pid", @log_file="/home/su207/decuong-ubuntu/log/thin.log", @app=#<Rack::URLMap:0x000000000465d5c0 @mapping=[[nil, "", /^(.*)/n, MainController]]>, @on_restart=#<Proc:0x000000000465d0e8@/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/controllers/controller.rb:85>, @signal_queue=[], @signal_timer=#<EventMachine::PeriodicTimer:0x000000000468a430 @interval=1, @code=#<Proc:0x000000000468a458@/var/lib/gems/2.4.0/gems/thin-1.7.2/lib/thin/server.rb:244>, @cancelled=false, @work=#<Method: EventMachine::PeriodicTimer#fire>>>, @stopping=false, @signature=3, @running=true>, @app=#<Rack::URLMap:0x000000000465d5c0 @mapping=[[nil, "", /^(.*)/n, MainController]]>, @threaded=nil, @can_persist=true, @idle=false>.post_process> |
async.close | #<EventMachine::DefaultDeferrable:0x0000000006315f28> |
rack.errors | #<Object:0x000000000284a7e0> |
rack.input | #<StringIO:0x0000000006316590> |
rack.logger | #<Rack::NullLogger:0x0000000004727f50 @app=#<Rack::Session::Cookie:0x0000000002fc8788 @secrets=["e352c0834ef51dcc184de5c2ac01e2ed1c92560c62773d5320b2554967557035a6935134b0414dd84af90394648d1ccb1d30e2593a3ad525c2955e16d27e8937"], @hmac=OpenSSL::Digest::SHA1, @coder=#<Rack::Session::Cookie::Base64::Marshal:0x0000000002fc8148>, @app=#<Rack::Protection::FrameOptions:0x0000000002fc9228 @app=#<Rack::Protection::HttpOrigin:0x0000000002fca358 @app=#<Rack::Protection::IPSpoofing:0x0000000002fca8d0 @app=#<Rack::Protection::JsonCsrf:0x0000000002fcb230 @app=#<Rack::Protection::PathTraversal:0x0000000002fcb8c0 @app=#<Rack::Protection::RemoteToken:0x0000000004720020 @app=#<Rack::Protection::SessionHijacking:0x0000000004720110 @app=#<Rack::Protection::XSSHeader:0x0000000004720200 @app=#<MainController:0x00000000046bd6f0 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Tilt::Cache:0x00000000046bd6a0 @cache={}>>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :xss_mode=>:block, :nosniff=>true, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :tracking_key=>:tracking, :encrypt_tracking=>true, :track=>["HTTP_USER_AGENT", "HTTP_ACCEPT_LANGUAGE"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :authenticity_param=>"authenticity_token", :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :frame_options=>:sameorigin, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>false}, @frame_options="SAMEORIGIN">, @default_options={:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :sidbits=>128, :secure_random=>SecureRandom, :secret=>"e352c0834ef51dcc184de5c2ac01e2ed1c92560c62773d5320b2554967557035a6935134b0414dd84af90394648d1ccb1d30e2593a3ad525c2955e16d27e8937", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0x0000000002fc8148>}, @key="rack.session", @cookie_only=true, @sidbits=128, @sid_secure=SecureRandom, @sid_length=32>> |
rack.multiprocess | false |
rack.multithread | false |
rack.request.cookie_hash | {} |
rack.request.query_hash | {} |
rack.request.query_string | |
rack.run_once | false |
rack.session | {"session_id"=>"28d09a2797c58e689b9cda727191f352d5ef9718055f1459a2d268b9ad0b59c9", "csrf"=>"8xFtUB2m9FH8w08D7jRV6ChWejl4vuKuIea3TKDLEBw=", "tracking"=>{"HTTP_USER_AGENT"=>"ec0660ee20674482e3fbf9df2da732a482688d77", "HTTP_ACCEPT_LANGUAGE"=>"da39a3ee5e6b4b0d3255bfef95601890afd80709"}} |
rack.session.options | {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :sidbits=>128, :secure_random=>SecureRandom, :secret=>"e352c0834ef51dcc184de5c2ac01e2ed1c92560c62773d5320b2554967557035a6935134b0414dd84af90394648d1ccb1d30e2593a3ad525c2955e16d27e8937", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0x0000000002fc8148>} |
rack.session.unpacked_cookie_data | {"session_id"=>"28d09a2797c58e689b9cda727191f352d5ef9718055f1459a2d268b9ad0b59c9"} |
rack.url_scheme | http |
rack.version | [1, 0] |
sinatra.accept | [#<Sinatra::Request::AcceptEntry:0x000000000630c248 @entry="*/*", @type="*/*", @params={}, @q=1.0>] |
sinatra.error | #<Errno::EHOSTUNREACH: Failed to open TCP connection to 10.1.0.236:8088 (No route to host - connect(2) for "10.1.0.236" port 8088)> |
sinatra.error.params | {"ma_mon_hoc"=>"HCM31031"} |
sinatra.route | GET /show/:ma_mon_hoc |
You're seeing this error because you have
enabled the show_exceptions
setting.