card_prices.rb
block in <class:WebApp>
/srv/api/yugioh_card_prices/web/routes/card_prices.rb
in
block in <class:WebApp>
if @price_history.count > 0 and @price_history.first[:created_at].is_a? String
@price_history.each do | item |
item[:created_at] = Chronic.parse item[:created_at]
end
end
@print_tag = card_number
@rarity = set_item['rarity']
# Get card rulings
item = CardRulings.filter(:name => @card_data[:name]).first
@rulings = (not item.nil?) ? item.values : {:ocg => "Unlimited",
:advanced => "Unlimited",
:traditional => "Unlimited"}
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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.zero? ?
proc { |a, _p| unbound_method.bind(a).call } :
proc { |a, p| unbound_method.bind(a).call(*p) }
[pattern, conditions, wrapper]
end
def compile(path, route_mustermann_opts = {})
Mustermann.new(path, **mustermann_opts.merge(route_mustermann_opts))
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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.zero? ?
proc { |a, _p| unbound_method.bind(a).call } :
proc { |a, p| unbound_method.bind(a).call(*p) }
[pattern, conditions, wrapper]
end
def compile(path, route_mustermann_opts = {})
Mustermann.new(path, **mustermann_opts.merge(route_mustermann_opts))
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block (3 levels) in route!
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('Content-Type') unless @pinned_response
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
# Run routes defined in superclass.
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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.
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block (2 levels) in route!
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('Content-Type') unless @pinned_response
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
# Run routes defined in superclass.
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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 StandardError
@env['sinatra.error.params'] = @params
raise
ensure
params ||= {}
params.each { |k, _| @params.delete(k) } unless @env['sinatra.error.params']
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
catch
captures = pattern.match(route).captures.map { |c| URI_INSTANCE.unescape(c) if c }
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 StandardError
@env['sinatra.error.params'] = @params
raise
ensure
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
process_route
captures = pattern.match(route).captures.map { |c| URI_INSTANCE.unescape(c) if c }
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 StandardError
@env['sinatra.error.params'] = @params
raise
ensure
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block in route!
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('Content-Type') unless @pinned_response
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
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
each
end
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('Content-Type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
route!
end
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('Content-Type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block in dispatch!
end
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before do
@pinned_response = !response['Content-Type'].nil?
end
route!
end
rescue ::Exception => e
invoke { handle_exception!(e) }
ensure
begin
filter! :after unless env['sinatra.static_file']
rescue ::Exception => e
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
dispatch!
@params.merge!(@request.params).each do |key, val|
next unless val.respond_to?(:force_encoding)
val = val.dup if val.frozen?
@params[key] = force_encoding(val)
end
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before do
@pinned_response = !response['Content-Type'].nil?
end
route!
end
rescue ::Exception => e
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
block in call!
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
@pinned_response = nil
template_cache.clear if settings.reload_templates
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
unless @response['Content-Type']
if Array === body && body[0].respond_to?(:content_type)
content_type body[0].content_type
elsif (default = settings.default_content_type)
content_type default
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
call!
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
@pinned_response = nil
template_cache.clear if settings.reload_templates
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
unless @response['Content-Type']
if Array === body && body[0].respond_to?(:content_type)
content_type body[0].content_type
elsif (default = settings.default_content_type)
content_type default
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
call
@template_cache = Tilt::Cache.new
@pinned_response = nil # whether a before! filter pinned the content-type
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
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-protection-3.0.6/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
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-protection-3.0.6/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) && (result.size == 3)
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-protection-3.0.6/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) && (result.size == 3)
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-protection-3.0.6/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]
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-protection-3.0.6/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) && (result.size == 3)
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-protection-3.0.6/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) && (result.size == 3)
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-protection-3.0.6/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
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/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
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/lib/rack/session/abstract/id.rb
in
call
@key = @default_options.delete(:key)
@cookie_only = @default_options.delete(:cookie_only)
@same_site = @default_options.delete(:same_site)
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
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/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
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/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
]
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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)
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
call
# Some Rack handlers (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 = app.call(env)
callback = env['async.callback']
return result unless callback && async?(*result)
after_response { callback.call result }
setup_close(env, *result)
throw :async
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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_for_deprecation(message)
warn message + "\n\tfrom #{cleaned_caller.first.join(':')}"
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/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
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/lib/rack/tempfile_reaper.rb
in
call
class TempfileReaper
def initialize(app)
@app = app
end
def call(env)
env[RACK_TEMPFILES] ||= []
status, headers, body = @app.call(env)
body_proxy = BodyProxy.new(body) do
env[RACK_TEMPFILES].each(&:close!) unless env[RACK_TEMPFILES].nil?
end
[status, headers, body_proxy]
end
end
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/lib/rack/lint.rb
in
_call
assert("No env given") { env }
check_env env
env[RACK_INPUT] = InputWrapper.new(env[RACK_INPUT])
env[RACK_ERRORS] = ErrorWrapper.new(env[RACK_ERRORS])
## and returns an Array of exactly three values:
ary = @app.call(env)
assert("response is not an Array, but #{ary.class}") {
ary.kind_of? Array
}
assert("response array has #{ary.size} elements instead of 3") {
ary.size == 3
}
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/lib/rack/lint.rb
in
call
## after to catch all mistakes.
## = Rack applications
## A Rack application is a Ruby object (not a class) that
## responds to +call+.
def call(env = nil)
dup._call(env)
end
def _call(env)
## It takes exactly one argument, the *environment*
assert("No env given") { env }
check_env env
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/lib/rack/show_exceptions.rb
in
call
CONTEXT = 7
def initialize(app)
@app = app
end
def call(env)
@app.call(env)
rescue StandardError, LoadError, SyntaxError => e
exception_string = dump_exception(e)
env[RACK_ERRORS].puts(exception_string)
env[RACK_ERRORS].flush
if accepts_html?(env)
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/lib/rack/common_logger.rb
in
call
# will not be logged, so if exception handling middleware are used,
# they should be loaded after this middleware. Additionally, because
# the logging happens after the request body has been fully sent, any
# exceptions raised during the sending of the response body will
# cause the request not to be logged.
def call(env)
began_at = Utils.clock_time
status, headers, body = @app.call(env)
headers = Utils::HeaderHash[headers]
body = BodyProxy.new(body) { log(env, status, headers, began_at) }
[status, headers, body]
end
private
/home/sally/.rvm/gems/ruby-3.0.0/gems/sinatra-3.0.6/lib/sinatra/base.rb
in
call
env['sinatra.commonlogger'] ? @app.call(env) : super
end
superclass.class_eval do
alias_method :call_without_check, :call unless method_defined? :call_without_check
def call(env)
env['sinatra.commonlogger'] = true
call_without_check(env)
end
end
end
class Error < StandardError # :nodoc:
end
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/lib/rack/chunked.rb
in
call
end
end
# If the rack app returns a response that should have a body,
# but does not have Content-Length or Transfer-Encoding headers,
# modify the response to use chunked Transfer-Encoding.
def call(env)
status, headers, body = @app.call(env)
headers = HeaderHash[headers]
if chunkable_version?(env[SERVER_PROTOCOL]) &&
!STATUS_WITH_NO_ENTITY_BODY.key?(status.to_i) &&
!headers[CONTENT_LENGTH] &&
!headers[TRANSFER_ENCODING]
/home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/lib/rack/content_length.rb
in
call
include Rack::Utils
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
headers = HeaderHash[headers]
if !STATUS_WITH_NO_ENTITY_BODY.key?(status.to_i) &&
!headers[CONTENT_LENGTH] &&
!headers[TRANSFER_ENCODING]
obody = body
/home/sally/.rvm/gems/ruby-3.0.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb
in
process_client
env["rack.early_hints"] = lambda do |headers|
e103_response_write(client, headers)
end
end
env["rack.after_reply"] = []
status, headers, body = @app.call(env)
begin
return if @request.hijacked?
if 100 == status.to_i
e100_response_write(client, env)
status, headers, body = @app.call(env)
/home/sally/.rvm/gems/ruby-3.0.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb
in
worker_loop
begin
reopen = reopen_worker_logs(worker.nr) if reopen
worker.tick = time_now.to_i
while sock = ready.shift
# Unicorn::Worker#kgio_tryaccept is not like accept(2) at all,
# but that will return false
if client = sock.kgio_tryaccept
process_client(client)
worker.tick = time_now.to_i
end
break if reopen
end
# timeout so we can .tick and keep parent from SIGKILL-ing us
worker.tick = time_now.to_i
/home/sally/.rvm/gems/ruby-3.0.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb
in
spawn_missing_workers
worker = Unicorn::Worker.new(worker_nr)
before_fork.call(self, worker)
pid = @worker_exec ? worker_spawn(worker) : fork
unless pid
after_fork_internal
worker_loop(worker)
exit
end
@workers[pid] = worker
worker.atfork_parent
end
rescue => e
/home/sally/.rvm/gems/ruby-3.0.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb
in
maintain_worker_count
rescue => e
@logger.error(e) rescue nil
exit!
end
def maintain_worker_count
(off = @workers.size - worker_processes) == 0 and return
off < 0 and return spawn_missing_workers
@workers.each_value { |w| w.nr >= worker_processes and w.soft_kill(:QUIT) }
end
# if we get any error, try to write something back to the client
# assuming we haven't closed the socket, but don't get hung up
# if the socket is already closed or broken. We'll always ensure
# the socket is closed at the end of this function
/home/sally/.rvm/gems/ruby-3.0.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb
in
join
# machine) comes out of suspend/hibernation
if (last_check + @timeout) >= (last_check = time_now)
sleep_time = murder_lazy_workers
else
sleep_time = @timeout/2.0 + 1
@logger.debug("waiting #{sleep_time}s after suspend/hibernation")
end
maintain_worker_count if respawn
master_sleep(sleep_time)
when :QUIT # graceful shutdown
break
when :TERM, :INT # immediate shutdown
stop(false)
break
when :USR1 # rotate logs
/home/sally/.rvm/gems/ruby-3.0.0/gems/unicorn-6.1.0/bin/unicorn
in
<top (required)>
:unicorn_options => options,
:app => app,
:daemonize => rackup_opts[:daemonize],
})
end
Unicorn::Launcher.daemonize!(options) if rackup_opts[:daemonize]
Unicorn::HttpServer.new(app, options).start.join
/home/sally/.rvm/gems/ruby-3.0.0/bin/unicorn
in
load
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('unicorn', 'unicorn', version)
else
gem "unicorn", version
load Gem.bin_path("unicorn", "unicorn", version)
end
/home/sally/.rvm/gems/ruby-3.0.0/bin/unicorn
in
<main>
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('unicorn', 'unicorn', version)
else
gem "unicorn", version
load Gem.bin_path("unicorn", "unicorn", version)
end
/home/sally/.rvm/gems/ruby-3.0.0/bin/ruby_executable_hooks
in
eval
content = File.read($0)
if (index = content.index("\n#!ruby\n")) && index > 0
skipped_content = content.slice!(0..index)
start_line = skipped_content.count("\n") + 1
eval content, binding, $0, start_line
else
eval content, binding, $0
end
/home/sally/.rvm/gems/ruby-3.0.0/bin/ruby_executable_hooks
in
<main>
content = File.read($0)
if (index = content.index("\n#!ruby\n")) && index > 0
skipped_content = content.slice!(0..index)
start_line = skipped_content.count("\n") + 1
eval content, binding, $0, start_line
else
eval content, binding, $0
end
Variable | Value |
---|---|
rarity | "Super Rare" |
No POST data.
Variable | Value |
---|---|
HTTP_ACCEPT | */* |
HTTP_ACCEPT_ENCODING | gzip, br |
HTTP_CDN_LOOP | cloudflare |
HTTP_CF_CONNECTING_IP | 3.230.76.153 |
HTTP_CF_IPCOUNTRY | US |
HTTP_CF_RAY | 86b85c0a1eec1fe5-IAD |
HTTP_CF_VISITOR | {"scheme":"https"} |
HTTP_CONNECTION | close |
HTTP_HOST | yugiohprices.com |
HTTP_USER_AGENT | claudebot |
HTTP_VERSION | HTTP/1.0 |
HTTP_X_FORWARDED_FOR | 3.230.76.153, 172.71.222.94 |
HTTP_X_FORWARDED_PROTO | https |
HTTP_X_REAL_IP | 172.71.222.94 |
PATH_INFO | /price_history/DBT-EN003 |
QUERY_STRING | rarity=Super%20Rare |
REMOTE_ADDR | 127.0.0.1 |
REQUEST_METHOD | GET |
REQUEST_PATH | /price_history/DBT-EN003 |
REQUEST_URI | /price_history/DBT-EN003?rarity=Super%20Rare |
SCRIPT_NAME | |
SERVER_NAME | yugiohprices.com |
SERVER_PORT | 443 |
SERVER_PROTOCOL | HTTP/1.0 |
SERVER_SOFTWARE | Unicorn 6.1.0 |
rack.after_reply | [] |
rack.errors | #<Object:0x0000000002681620> |
rack.hijack | #<Proc:0x0000000004f76148 /home/sally/.rvm/gems/ruby-3.0.0/gems/rack-2.2.7/lib/rack/lint.rb:567> |
rack.hijack? | true |
rack.input | #<Rack::Lint::InputWrapper:0x0000000004f75d88 @input=#<StringIO:0x00000000022b3b10>> |
rack.logger | #<Rack::NullLogger:0x00000000044c9650 @app=#<Rack::Protection::EncryptedCookie:0x00000000044c9ba0 @secrets=["6\xF1hv?\x94c\xB5\xA4\x81\x934\xA8\xDE\xF7\xFAn\xA8\x06\xD45U\e\xCD\x06\xC9@\x95y\xCF\a\e\x84\x1A]\xBB\xB8\f\xC9\t\x84`\xD7){\x85#;\xD2\x88.\xBC\ea]=t\xB1\xF1<T{\xCA'"], @legacy_hmac=false, @coder=#<Rack::Protection::EncryptedCookie::Marshal:0x00000000044c9920>, @app=#<Rack::Protection::FrameOptions:0x00000000044c9e70 @app=#<Rack::Protection::HttpOrigin:0x00000000044ca3e8 @app=#<Rack::Protection::IPSpoofing:0x00000000044ca578 @app=#<Rack::Protection::JsonCsrf:0x00000000044ca758 @app=#<Rack::Protection::RemoteToken:0x00000000044ca9b0 @app=#<Rack::Protection::SessionHijacking:0x00000000044cacf8 @app=#<Rack::Protection::XSSHeader:0x00000000044cb388 @app=#<CardPrices::WebApp:0x000000000442d688 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Tilt::Cache:0x000000000442d458 @cache={}>, @pinned_response=nil>, @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'", :except=>:path_traversal, :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, :track=>["HTTP_USER_AGENT"], :img_src=>"'self' data:", :font_src=>"'self'", :except=>:path_traversal, :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", :key=>:csrf, :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :except=>:path_traversal, :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'", :except=>:path_traversal, :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'", :except=>:path_traversal, :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'", :except=>:path_traversal, :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'", :except=>:path_traversal, :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=>"36f168763f9463b5a4819334a8def7fa6ea806d435551bcd06c9409579cf071b841a5dbbb80cc9098460d7297b85233bd2882ebc1b615d3d74b1f13c547bca27", :coder=>#<Rack::Protection::EncryptedCookie::Marshal:0x00000000044c9920>}, @key="rack.session", @cookie_only=true, @same_site=nil, @sidbits=128, @sid_secure=SecureRandom, @sid_length=32>> |
rack.multiprocess | true |
rack.multithread | false |
rack.request.cookie_hash | {"currency"=>"USD", "hide_multiples"=>"no", "show_vendors"=>"eBay,Troll and Toad,TCGPlayer,Amazon,Poke Order,Card Central,Alter Reality,Ideal808,CoreTCG"} |
rack.request.query_hash | {"rarity"=>"Super Rare"} |
rack.request.query_string | rarity=Super%20Rare |
rack.run_once | false |
rack.session | {"session_id"=>"022b64be2831c29fbd6c5408c5bb40027e55da4e8ae1db7ffb847af7ee07fd77", "csrf"=>"UXvjaeo7O9f-S5RTwmwwvGC-Cfa4gDdvEmU5BpBZ4Yk=", "tracking"=>{"HTTP_USER_AGENT"=>"claudebot"}} |
rack.session.options | {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :sidbits=>128, :secure_random=>SecureRandom, :secret=>"36f168763f9463b5a4819334a8def7fa6ea806d435551bcd06c9409579cf071b841a5dbbb80cc9098460d7297b85233bd2882ebc1b615d3d74b1f13c547bca27", :coder=>#<Rack::Protection::EncryptedCookie::Marshal:0x00000000044c9920>} |
rack.session.unpacked_cookie_data | {"session_id"=>"022b64be2831c29fbd6c5408c5bb40027e55da4e8ae1db7ffb847af7ee07fd77"} |
rack.tempfiles | [] |
rack.url_scheme | https |
rack.version | [1, 2] |
sinatra.accept | [#<Sinatra::Request::AcceptEntry:0x0000000008aa9418 @entry="*/*", @type="*/*", @params={}, @q=1.0>] |
sinatra.commonlogger | true |
sinatra.error | #<NoMethodError: undefined method `[]' for nil:NilClass> |
sinatra.error.params | {"rarity"=>"Super Rare", "card_number"=>"DBT-EN003"} |
sinatra.route | GET /price_history/:card_number |
unicorn.socket | #<Kgio::Socket:fd 6> |
You're seeing this error because you have
enabled the show_exceptions
setting.