app.rb
binread
/home/ujif/dissovet/app/app.rb
in
binread
redirect result + asset_timestamp(result)
end
get "/cache/Dissertation/show/:id-:page.jpg" do
thesis = Dissertation.get(params[:id]) || not_found
path = thesis.extract(params[:page]||1) || not_found
content_type 'image/jpeg'
File.binread path
end
get '/sitemap.xml' do
content_type 'application/xml'
@pages = Page.all.published
render :slim, :'layouts/sitemap.xml', :format => :xhtml
end
/home/ujif/dissovet/app/app.rb
in
block in <class:Application>
redirect result + asset_timestamp(result)
end
get "/cache/Dissertation/show/:id-:page.jpg" do
thesis = Dissertation.get(params[:id]) || not_found
path = thesis.extract(params[:page]||1) || not_found
content_type 'image/jpeg'
File.binread path
end
get '/sitemap.xml' do
content_type 'application/xml'
@pages = Page.all.published
render :slim, :'layouts/sitemap.xml', :format => :xhtml
end
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
call
# Sinatra defaults
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
block = block.arity != 0 ?
proc { |a,p| unbound_method.bind(a).call(*p) } :
proc { |a,p| unbound_method.bind(a).call }
invoke_hook(:route_added, verb, path, block)
# HTTPRouter route construction
route = router.add(path, route_options)
route.name = name if name
route.action = action
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
block in route
# Sinatra defaults
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
block = block.arity != 0 ?
proc { |a,p| unbound_method.bind(a).call(*p) } :
proc { |a,p| unbound_method.bind(a).call }
invoke_hook(:route_added, verb, path, block)
# HTTPRouter route construction
route = router.add(path, route_options)
route.name = name if name
route.action = action
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
[]
parent_layout = @layout
successful = false
begin
filter! :before
(@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
@layout = path.route.use_layout if path.route.use_layout
@route.custom_conditions.each { |block| pass if block.bind(self).call == false }
halt_response = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
@_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
successful = true
halt halt_response
ensure
(@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
@layout = parent_layout
@params = original_params
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
block (3 levels) in process_destination_path
parent_layout = @layout
successful = false
begin
filter! :before
(@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
@layout = path.route.use_layout if path.route.use_layout
@route.custom_conditions.each { |block| pass if block.bind(self).call == false }
halt_response = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
@_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
successful = true
halt halt_response
ensure
(@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
@layout = parent_layout
@params = original_params
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.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/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
block (2 levels) in process_destination_path
parent_layout = @layout
successful = false
begin
filter! :before
(@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
@layout = path.route.use_layout if path.route.use_layout
@route.custom_conditions.each { |block| pass if block.bind(self).call == false }
halt_response = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
@_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
successful = true
halt halt_response
ensure
(@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
@layout = parent_layout
@params = original_params
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
catch
parent_layout = @layout
successful = false
begin
filter! :before
(@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
@layout = path.route.use_layout if path.route.use_layout
@route.custom_conditions.each { |block| pass if block.bind(self).call == false }
halt_response = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
@_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
successful = true
halt halt_response
ensure
(@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
@layout = parent_layout
@params = original_params
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
block in process_destination_path
parent_layout = @layout
successful = false
begin
filter! :before
(@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
@layout = path.route.use_layout if path.route.use_layout
@route.custom_conditions.each { |block| pass if block.bind(self).call == false }
halt_response = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
@_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
successful = true
halt halt_response
ensure
(@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
@layout = parent_layout
@params = original_params
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
instance_eval
end
class HttpRouter
def rewrite_partial_path_info(env, request); end
def rewrite_path_info(env, request); end
def process_destination_path(path, env)
Thread.current['padrino.instance'].instance_eval do
request.route_obj = path.route
@_response_buffer = nil
@route = path.route
@params ||= {}
@params.update(env['router.params'])
@block_params = if match_data = env['router.request'].extra_env['router.regex_match']
params_list = match_data.to_a
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
process_destination_path
end
class HttpRouter
def rewrite_partial_path_info(env, request); end
def rewrite_path_info(env, request); end
def process_destination_path(path, env)
Thread.current['padrino.instance'].instance_eval do
request.route_obj = path.route
@_response_buffer = nil
@route = path.route
@params ||= {}
@params.update(env['router.params'])
@block_params = if match_data = env['router.request'].extra_env['router.regex_match']
params_list = match_data.to_a
/home/ujif/vendor/ruby/2.1.0/gems/http_router-0.11.2/lib/http_router.rb
in
raw_call
def raw_call(env, &blk)
rack_request = ::Rack::Request.new(env)
request = Request.new(rack_request.path_info, rack_request)
if blk
@root.call(request, &blk)
request
else
@root.call(request) or no_response(request, env)
end
end
private
def compile
return if @compiled
@root.compile(@routes)
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
route!
rescue ::Exception => boom
invoke { handle_exception!(boom) } unless @env['sinatra.error']
end
end
def route!(base=settings, pass_block=nil)
Thread.current['padrino.instance'] = self
if base.compiled_router and match = base.compiled_router.call(@request.env)
if match.respond_to?(:each)
route_eval do
match[1].each { |k,v| response[k] = v }
status match[0]
route_missing if match[0] == 404
route_missing if allow = response['Allow'] and allow.include?(request.env['REQUEST_METHOD'])
end
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
block in dispatch!
def filter!(type, base=settings)
base.filters[type].each { |block| instance_eval(&block) }
end
def dispatch!
invoke do
static! if settings.static? && (request.get? || request.head?)
route!
end
rescue ::Exception => boom
filter! :before if boom.kind_of? ::Sinatra::NotFound
invoke { @boom_handled = handle_exception!(boom) }
ensure
@boom_handled or begin
filter! :after unless env['sinatra.static_file']
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb
in
block in invoke
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb
in
catch
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb
in
invoke
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb
in
dispatch!
private
def filter!(type, base=settings)
base.filters[type].each { |block| instance_eval(&block) }
end
def dispatch!
invoke do
static! if settings.static? && (request.get? || request.head?)
route!
end
rescue ::Exception => boom
filter! :before if boom.kind_of? ::Sinatra::NotFound
invoke { @boom_handled = handle_exception!(boom) }
ensure
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb
in
block in call!
@request = Request.new(env)
@response = Response.new
@params = indifferent_params(@request.params)
template_cache.clear if settings.reload_templates
force_encoding(@params)
@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
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb
in
block in invoke
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb
in
catch
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb
in
invoke
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb
in
call!
@request = Request.new(env)
@response = Response.new
@params = indifferent_params(@request.params)
template_cache.clear if settings.reload_templates
force_encoding(@params)
@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
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.6/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
@request = Request.new(env)
@response = Response.new
@params = indifferent_params(@request.params)
/home/ujif/vendor/ruby/2.1.0/gems/rack-pipeline-0.0.11/lib/rack-pipeline/base.rb
in
call
def call(env)
@env = env
env['rack-pipeline'] = self
if file_path = prepare_pipe(env['PATH_INFO'])
serve_file(file_path, env['HTTP_IF_MODIFIED_SINCE'])
else
@app.call(env)
end
rescue MustRepopulate
populate_pipelines
retry
end
private
/home/ujif/vendor/ruby/2.1.0/gems/rack-protection-1.5.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
/home/ujif/vendor/ruby/2.1.0/gems/rack-protection-1.5.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
/home/ujif/vendor/ruby/2.1.0/gems/rack-protection-1.5.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
/home/ujif/vendor/ruby/2.1.0/gems/rack-protection-1.5.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
/home/ujif/vendor/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb
in
call
# Array prototype has been patched to track data. Checks the referrer
# even on GET requests if the content type is JSON.
class JsonCsrf < Base
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(env) or [status, headers, body]
else
[status, headers, body]
end
/home/ujif/vendor/ruby/2.1.0/gems/rack-protection-1.5.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
/home/ujif/vendor/ruby/2.1.0/gems/rack-1.6.4/lib/rack/head.rb
in
call
# Rack::Head returns an empty body for all HEAD requests. It leaves
# all other requests unchanged.
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/ujif/vendor/ruby/2.1.0/gems/rack-1.6.4/lib/rack/methodoverride.rb
in
call
method = method_override(env)
if HTTP_METHODS.include?(method)
env["rack.methodoverride.original_method"] = env[REQUEST_METHOD]
env[REQUEST_METHOD] = method
end
end
@app.call(env)
end
def method_override(env)
req = Request.new(env)
method = method_override_param(req) ||
env[HTTP_METHOD_OVERRIDE_HEADER]
method.to_s.upcase
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/reloader/rack.rb
in
call
# Invoked in order to perform the reload as part of the request stack.
def call(env)
if @cooldown && Time.now > @last + @cooldown
Thread.list.size > 1 ? Thread.exclusive { Padrino.reload! } : Padrino.reload!
@last = Time.now
end
@app.call(env)
end
end
end
end
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/logger.rb
in
call
@app = app
@uri_root = uri_root.sub(/\/$/,"")
end
def call(env)
env['rack.logger'] = Padrino.logger
began_at = Time.now
status, header, body = @app.call(env)
log(env, status, header, began_at) if logger.debug?
[status, header, body]
end
private
def log(env, status, header, began_at)
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/show_exceptions.rb
in
call
def initialize(app)
@app = app
@template = ERB.new(TEMPLATE)
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"
exception_string = dump_exception(e)
else
/home/ujif/vendor/ruby/2.1.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb
in
context
def call(env)
context(env)
end
def context(env, app=@app)
prepare_session(env)
status, headers, body = app.call(env)
commit_session(env, status, headers, body)
end
private
def initialize_sid
@sidbits = @default_options[:sidbits]
/home/ujif/vendor/ruby/2.1.0/gems/rack-1.6.4/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)
prepare_session(env)
status, headers, body = app.call(env)
commit_session(env, status, headers, body)
end
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.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/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.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/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.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(message)
super message + "\n\tfrom #{cleaned_caller.first.join(':')}"
end
/home/ujif/vendor/ruby/2.1.0/gems/sinatra-1.4.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/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/router.rb
in
block in call
@mapping.each do |host, path, match, app|
next unless host.nil? || http_host =~ host
next unless path_info =~ match && rest = $1
next unless rest.empty? || rest[0] == ?/
rest = "/" if rest.empty?
last_result = app.call(env.merge('SCRIPT_NAME' => script_name + path, 'PATH_INFO' => rest))
cascade_setting = app.respond_to?(:cascade) ? app.cascade : true
cascade_statuses = cascade_setting.respond_to?(:include?) ? cascade_setting : Mounter::DEFAULT_CASCADE
break unless cascade_setting && cascade_statuses.include?(last_result[0])
end
last_result || begin
Padrino::Logger::Rack.new(nil,'/').send(:log, env, 404, {}, began_at) if logger.debug?
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/router.rb
in
each
def call(env)
began_at = Time.now
path_info = env["PATH_INFO"].to_s
script_name = env['SCRIPT_NAME']
http_host = env['HTTP_HOST']
last_result = nil
@mapping.each do |host, path, match, app|
next unless host.nil? || http_host =~ host
next unless path_info =~ match && rest = $1
next unless rest.empty? || rest[0] == ?/
rest = "/" if rest.empty?
last_result = app.call(env.merge('SCRIPT_NAME' => script_name + path, 'PATH_INFO' => rest))
/home/ujif/vendor/ruby/2.1.0/gems/padrino-core-0.12.0/lib/padrino-core/router.rb
in
call
def call(env)
began_at = Time.now
path_info = env["PATH_INFO"].to_s
script_name = env['SCRIPT_NAME']
http_host = env['HTTP_HOST']
last_result = nil
@mapping.each do |host, path, match, app|
next unless host.nil? || http_host =~ host
next unless path_info =~ match && rest = $1
next unless rest.empty? || rest[0] == ?/
rest = "/" if rest.empty?
last_result = app.call(env.merge('SCRIPT_NAME' => script_name + path, 'PATH_INFO' => rest))
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb
in
process_request
env[HTTP_VERSION] = HTTP_1_1
# Rails somehow modifies env['REQUEST_METHOD'], so we perform the comparison
# before the Rack application object is called.
is_head_request = env[REQUEST_METHOD] == HEAD
begin
status, headers, body = @app.call(env)
rescue => e
if !should_swallow_app_error?(e, socket_wrapper)
# It's a good idea to catch application exceptions here because
# otherwise maliciously crafted responses can crash the app,
# forcing it to be respawned, and thereby effectively DoSing it.
print_exception("Rack application object", e)
end
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb
in
accept_and_process_next_request
channel.io = connection
headers = parse_request(connection, channel, buffer)
end
if headers
prepare_request(connection, headers)
begin
if headers[REQUEST_METHOD] == GET
process_request(headers, connection, socket_wrapper, @protocol == :http)
elsif headers[REQUEST_METHOD] == PING
process_ping(headers, connection)
false
elsif headers[REQUEST_METHOD] == OOBW
process_oobw(headers, connection)
false
else
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb
in
main_loop
channel = MessageChannel.new
buffer = ''
buffer.force_encoding('binary') if buffer.respond_to?(:force_encoding)
begin
finish_callback.call
while true
hijacked = accept_and_process_next_request(socket_wrapper, channel, buffer)
socket_wrapper = Utils::UnseekableSocket.new if hijacked
end
rescue Interrupted
# Do nothing.
end
debug("Thread handler main loop exited normally")
ensure
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb
in
block (3 levels) in start_threads
@threads_mutex.synchronize do
@concurrency.times do |i|
thread = create_thread_and_abort_on_exception(i) do |number|
begin
Thread.current[:name] = "Worker #{number + 1}"
handler = thread_handler.new(self, main_socket_options)
handler.install
handler.main_loop(set_initialization_state_to_true)
ensure
set_initialization_state.call(false)
unregister_current_thread
end
end
@threads << thread
expected_nthreads += 1
/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb
in
block in create_thread_and_abort_on_exception
# This method requires 'thread' and 'ruby_core_enhancements'.
# If 'debug_logging' is loaded and included in the current module,
# it will use that for logging.
def create_thread_and_abort_on_exception(*args)
Thread.new do
Thread.current.abort_on_exception = true
begin
yield(*args)
rescue SystemExit
raise
rescue Exception => e
print_exception(nil, e)
exit(1)
end
end
No GET data.
No POST data.
Variable | Value |
---|---|
HTTP_ACCEPT | */* |
HTTP_HOST | dissovet.udsu.ru |
HTTP_REFERER | http://dissovet.udsu.ru/cache/Dissertation/show/647-143.jpg |
HTTP_USER_AGENT | claudebot |
HTTP_VERSION | HTTP/1.1 |
HTTP_X_FORWARDED_FOR | 35.175.172.94 |
HTTP_X_FORWARDED_PROTO | https |
HTTP_X_REAL_IP | 35.175.172.94 |
PASSENGER_CONNECT_PASSWORD | bMdhn966hMVGCrIZ |
PATH_INFO | /cache/Dissertation/show/647-143.jpg |
QUERY_STRING | |
REMOTE_ADDR | 10.6.7.200 |
REMOTE_PORT | 55716 |
REQUEST_METHOD | GET |
REQUEST_URI | /cache/Dissertation/show/647-143.jpg |
SCRIPT_NAME | |
SERVER_NAME | dissovet.udsu.ru |
SERVER_PORT | 80 |
SERVER_PROTOCOL | HTTP/1.1 |
SERVER_SOFTWARE | nginx/1.17.3 Phusion_Passenger/6.0.4 |
rack-pipeline | {:settings=>{:temp=>"/home/ujif/dissovet/tmp/RackPipeline", :compress=>false, :combine=>false, :bust_cache=>false, :css=>{:app=>["vendor/stylesheets/libraries/bootstrap-lite.css", "vendor/stylesheets/libraries/colorbox.css", "assets/stylesheets/elements/*.css", "assets/stylesheets/app/*.css"]}, :js=>{:app=>["vendor/javascripts/libraries/01-jquery.js", "vendor/javascripts/libraries/07-jquery.colorbox.js", "assets/javascripts/elements/*.js", "assets/javascripts/app/*.js"]}}, :assets=>{:js=>{:app=>{"vendor/javascripts/libraries/01-jquery.js"=>:raw, "vendor/javascripts/libraries/07-jquery.colorbox.js"=>:raw, "assets/javascripts/app/app-colorbox.js"=>:raw}}, :css=>{:app=>{"vendor/stylesheets/libraries/bootstrap-lite.css"=>:raw, "vendor/stylesheets/libraries/colorbox.css"=>:raw, "assets/stylesheets/elements/Folders.css"=>:raw, "assets/stylesheets/elements/Gallery.css"=>:raw, "assets/stylesheets/elements/Image.css"=>:raw, "assets/stylesheets/app/thesis.css"=>:raw}}}} |
rack.errors | #<Object:0x9d54c84> |
rack.hijack | #<Proc:0xb53618d8@/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:84 (lambda)> |
rack.hijack? | true |
rack.input | #<PhusionPassenger::Utils::TeeInput:0xb5361950 @len=0, @socket=#<PhusionPassenger::Utils::UnseekableSocket:0x9cadc7c @socket=#<UNIXSocket:fd 13>, @simulate_eof=true>, @bytes_read=0, @tmp=#<StringIO:0xb5361928>> |
rack.logger | #<Padrino::Logger:0x98c7540 @buffer=[], @auto_flush=true, @level=-1, @log=#<File:/home/ujif/dissovet/log/development.log>, @format_datetime=" [%Y-%m-%d %H:%M:%S] ", @format_message="%s - %s %s", @log_static=false, @colorize_logging=true, @_pad=8> |
rack.multiprocess | true |
rack.multithread | false |
rack.request.cookie_hash | {} |
rack.request.query_hash | {} |
rack.request.query_string | |
rack.run_once | false |
rack.session | {"session_id"=>"c3ab7d085e95b3bb46e8448f458b21e7a95b193898b2100d52c8c2fa121c6543", "csrf"=>"4609f0c277fabae1373c4d761d2b80eb", "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=>"fd3a32d61be75844ffaf63deaeff410cd4d686f0de3154f4497a3cab0d493289", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0xa16b3cc>} |
rack.session.unpacked_cookie_data | {"session_id"=>"c3ab7d085e95b3bb46e8448f458b21e7a95b193898b2100d52c8c2fa121c6543"} |
rack.url_scheme | http |
rack.version | [1, 2] |
router.params | {"id"=>"647", "page"=>"143"} |
router.request | #<HttpRouter::Request:0xb5328560 @rack_request=#<Rack::Request:0xb5328574 @env={"REQUEST_URI"=>"/cache/Dissertation/show/647-143.jpg", "PATH_INFO"=>"/cache/Dissertation/show/647-143.jpg", "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "REQUEST_METHOD"=>"GET", "SERVER_NAME"=>"dissovet.udsu.ru", "SERVER_PORT"=>"80", "SERVER_SOFTWARE"=>"nginx/1.17.3 Phusion_Passenger/6.0.4", "SERVER_PROTOCOL"=>"HTTP/1.1", "REMOTE_ADDR"=>"10.6.7.200", "REMOTE_PORT"=>"55716", "PASSENGER_CONNECT_PASSWORD"=>"bMdhn966hMVGCrIZ", "HTTP_X_REAL_IP"=>"35.175.172.94", "HTTP_X_FORWARDED_PROTO"=>"https", "HTTP_USER_AGENT"=>"claudebot", "HTTP_REFERER"=>"http://dissovet.udsu.ru/cache/Dissertation/show/647-143.jpg", "HTTP_ACCEPT"=>"*/*", "HTTP_HOST"=>"dissovet.udsu.ru", "HTTP_X_FORWARDED_FOR"=>"35.175.172.94", "rack.version"=>[1, 2], "rack.input"=>#<PhusionPassenger::Utils::TeeInput:0xb5361950 @len=0, @socket=#<PhusionPassenger::Utils::UnseekableSocket:0x9cadc7c @socket=#<UNIXSocket:fd 13>, @simulate_eof=true>, @bytes_read=0, @tmp=#<StringIO:0xb5361928>>, "rack.errors"=>#<Object:0x9d54c84>, "rack.multithread"=>false, "rack.multiprocess"=>true, "rack.run_once"=>false, "rack.url_scheme"=>"http", "rack.hijack?"=>true, "rack.hijack"=>#<Proc:0xb53618d8@/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:84 (lambda)>, "HTTP_VERSION"=>"HTTP/1.1", "rack.session"=>{"session_id"=>"c3ab7d085e95b3bb46e8448f458b21e7a95b193898b2100d52c8c2fa121c6543", "csrf"=>"4609f0c277fabae1373c4d761d2b80eb", "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=>"fd3a32d61be75844ffaf63deaeff410cd4d686f0de3154f4497a3cab0d493289", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0xa16b3cc>}, "rack.logger"=>#<Padrino::Logger:0x98c7540 @buffer=[], @auto_flush=true, @level=-1, @log=#<File:/home/ujif/dissovet/log/development.log>, @format_datetime=" [%Y-%m-%d %H:%M:%S] ", @format_message="%s - %s %s", @log_static=false, @colorize_logging=true, @_pad=8>, "rack.request.cookie_hash"=>{}, "rack.session.unpacked_cookie_data"=>{"session_id"=>"c3ab7d085e95b3bb46e8448f458b21e7a95b193898b2100d52c8c2fa121c6543"}, "rack-pipeline"=>{:settings=>{:temp=>"/home/ujif/dissovet/tmp/RackPipeline", :compress=>false, :combine=>false, :bust_cache=>false, :css=>{:app=>["vendor/stylesheets/libraries/bootstrap-lite.css", "vendor/stylesheets/libraries/colorbox.css", "assets/stylesheets/elements/*.css", "assets/stylesheets/app/*.css"]}, :js=>{:app=>["vendor/javascripts/libraries/01-jquery.js", "vendor/javascripts/libraries/07-jquery.colorbox.js", "assets/javascripts/elements/*.js", "assets/javascripts/app/*.js"]}}, :assets=>{:js=>{:app=>{"vendor/javascripts/libraries/01-jquery.js"=>:raw, "vendor/javascripts/libraries/07-jquery.colorbox.js"=>:raw, "assets/javascripts/app/app-colorbox.js"=>:raw}}, :css=>{:app=>{"vendor/stylesheets/libraries/bootstrap-lite.css"=>:raw, "vendor/stylesheets/libraries/colorbox.css"=>:raw, "assets/stylesheets/elements/Folders.css"=>:raw, "assets/stylesheets/elements/Gallery.css"=>:raw, "assets/stylesheets/elements/Image.css"=>:raw, "assets/stylesheets/app/thesis.css"=>:raw}}}}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "router.request"=>#<HttpRouter::Request:0xb5328560 ...>, "router.params"=>{"id"=>"647", "page"=>"143"}, "sinatra.error"=>#<Errno::ENOENT: No such file or directory @ rb_sysopen - /home/ujif/dissovet/public/cache/Dissertation/show/647-143.jpg>, "sinatra.accept"=>[#<Sinatra::Request::AcceptEntry:0xb5ada04c @entry="*/*", @type="*/*", @params={}, @q=1.0>]}>, @path=[], @extra_env={}, @params=["647", "143"], @acceptable_methods=#<Set: {}>> |
sinatra.accept | [#<Sinatra::Request::AcceptEntry:0xb5ada04c @entry="*/*", @type="*/*", @params={}, @q=1.0>] |
sinatra.error | #<Errno::ENOENT: No such file or directory @ rb_sysopen - /home/ujif/dissovet/public/cache/Dissertation/show/647-143.jpg> |
You're seeing this error because you have
enabled the show_exceptions
setting.