repository.rb
lookup
/usr/local/bundle/gems/rugged-1.1.1/lib/rugged/repository.rb
in
lookup
walker.each(&block)
end
# Look up a SHA1.
#
# Returns one of the four classes that inherit from Rugged::Object.
def lookup(oid)
Rugged::Object.lookup(self, oid)
end
# Look up an object by a revision string.
#
# Returns one of the four classes that inherit from Rugged::Object.
def rev_parse(spec)
Rugged::Object.rev_parse(self, spec)
/usr/local/bundle/gems/rugged-1.1.1/lib/rugged/repository.rb
in
lookup
walker.each(&block)
end
# Look up a SHA1.
#
# Returns one of the four classes that inherit from Rugged::Object.
def lookup(oid)
Rugged::Object.lookup(self, oid)
end
# Look up an object by a revision string.
#
# Returns one of the four classes that inherit from Rugged::Object.
def rev_parse(spec)
Rugged::Object.rev_parse(self, spec)
/usr/local/bundle/gems/gollum-rugged_adapter-1.1.2/lib/rugged_adapter/git_layer_rugged.rb
in
lstree
def log(commit = 'refs/heads/master', path = nil, options = {})
git.log(commit, path, **options)
end
def lstree(sha, options = {})
results = []
@repo.lookup(sha).tree.walk(:postorder) do |root, entry|
entry[:sha] = entry[:oid]
entry[:mode] = entry[:filemode].to_s(8)
entry[:type] = entry[:type].to_s
entry[:path] = "#{root}#{entry[:name]}"
results << entry
end
results
/usr/local/bundle/gems/gollum-lib-5.1.3/lib/gollum-lib/git_access.rb
in
tree!
# Looks up the Git blobs for a given commit.
#
# sha - String commit SHA.
#
# Returns an Array of BlobEntry instances.
def tree!(sha)
tree = @repo.lstree(sha, { :recursive => true })
items = []
tree.each do |entry|
if entry[:type] == 'blob'
items << BlobEntry.new(entry[:sha], entry[:path], entry[:size], entry[:mode].to_i(8))
end
end
if (dir = @page_file_dir)
/usr/local/bundle/gems/gollum-lib-5.1.3/lib/gollum-lib/git_access.rb
in
block in tree
# given commit.
#
# ref - A String Git reference or Git SHA to a commit.
#
# Returns an Array of BlobEntry instances.
def tree(ref)
if (sha = ref_to_sha(ref))
get_cache(:tree, sha) { tree!(sha) }
else
[]
end
end
# Public: Fetches the contents of the Git blob at the given SHA.
#
/usr/local/bundle/gems/gollum-lib-5.1.3/lib/gollum-lib/git_access.rb
in
get_cache
#
# Yields a block to pass to the cache.
# Returns the cached result.
def get_cache(name, key)
cache = instance_variable_get("@#{name}_map")
value = cache[key]
if value.nil? && block_given?
set_cache(name, key, value = yield)
end
value == :_nil ? nil : value
end
# Writes some data to the internal cache.
#
# name - The cache prefix used in building the full cache key.
/usr/local/bundle/gems/gollum-lib-5.1.3/lib/gollum-lib/git_access.rb
in
tree
# given commit.
#
# ref - A String Git reference or Git SHA to a commit.
#
# Returns an Array of BlobEntry instances.
def tree(ref)
if (sha = ref_to_sha(ref))
get_cache(:tree, sha) { tree!(sha) }
else
[]
end
end
# Public: Fetches the contents of the Git blob at the given SHA.
#
/usr/local/bundle/gems/gollum-lib-5.1.3/lib/gollum-lib/wiki.rb
in
tree_map_for
#
# Returns an Array of BlobEntry instances.
def tree_map_for(ref, ignore_page_file_dir = false)
if ignore_page_file_dir && !@page_file_dir.nil?
@root_access ||= GitAccess.new(path, nil, @repo_is_bare)
@root_access.tree(ref)
else
@access.tree(ref)
end
rescue Gollum::Git::NoSuchShaFound
[]
end
def inspect
%(#<#{self.class.name}:#{object_id} #{@repo.path}>)
/usr/local/bundle/gems/gollum-lib-5.1.3/lib/gollum-lib/file.rb
in
find
# that exists on the disk.
# global_match - If true, find a File matching path's filename, but not it's directory (so anywhere in the repo)
#
# Returns a Gollum::File or nil if the file could not be found. Note
# that if you specify try_on_disk=true, you may or may not get a file
# for which on_disk? is actually true.
def self.find(wiki, path, version, try_on_disk = false, global_match = false)
map = wiki.tree_map_for(version.to_s)
query_path = Pathname.new(::File.join(['/', wiki.page_file_dir, path].compact)).cleanpath.to_s
query_path.sub!(/^\/\//, '/') if Gem.win_platform? # On Windows, Pathname#cleanpath will leave double slashes at the start of a path intact, so sub them out.
begin
entry = map.detect do |entry|
path_match(query_path, entry, global_match, wiki.hyphened_tag_lookup, wiki.case_insensitive_tag_lookup)
/usr/local/bundle/gems/gollum-lib-5.1.3/lib/gollum-lib/wiki.rb
in
page
#
# path - The String path to the the wiki page (may or may not include file extension).
# version - The String version ID to find (default: @ref).
# global_match - If true, find a File matching path's filename, but not it's directory (so anywhere in the repo)
#
# Returns a Gollum::Page or nil if no matching page was found.
def page(path, version = nil, global_match = false)
::Gollum::Page.find(self, path, version.nil? ? @ref : version, false, global_match)
end
# Public: Get the static file for a given name.
#
# name - The full String pathname to the file.
# version - The String version ID to find (default: @ref).
# try_on_disk - If true, try to return just a reference to a file
/usr/local/bundle/gems/gollum-5.3.0/lib/gollum/app.rb
in
wiki_page
content ||= page.raw_data
wiki.update_page(page, name, format, content.to_s, commit)
end
def wiki_page(path, version = nil, wiki = nil)
pathname = (Pathname.new('/') + path).cleanpath
wiki = wiki_new if wiki.nil?
OpenStruct.new(:wiki => wiki, :page => wiki.page(pathname.to_s, version = version),
:name => pathname.basename.sub_ext('').to_s, :path => pathname.dirname.to_s, :ext => pathname.extname, :fullname => pathname.basename.to_s, :fullpath => pathname.to_s)
end
def wiki_new
Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
end
/usr/local/bundle/gems/gollum-5.3.0/lib/gollum/app.rb
in
block in <class:App>
mustache :overview
end
end # gollum namespace
get %r{/(.+?)/([0-9a-f]{40})} do
file_path = params[:captures][0]
version = params[:captures][1]
wikip = wiki_page(file_path, version)
name = wikip.fullname
path = wikip.path
if page = wikip.page
@page = page
@name = name
@content = page.formatted_data
@version = version
/usr/local/bundle/gems/sinatra-2.2.0/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
/usr/local/bundle/gems/sinatra-2.2.0/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
/usr/local/bundle/gems/sinatra-2.2.0/lib/sinatra/base.rb
in
block (3 levels) in route!
def route!(base = settings, pass_block = nil)
if 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
end
/usr/local/bundle/gems/sinatra-2.2.0/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.
/usr/local/bundle/gems/sinatra-2.2.0/lib/sinatra/base.rb
in
block (2 levels) in route!
def route!(base = settings, pass_block = nil)
if 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
end
/usr/local/bundle/gems/sinatra-2.2.0/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 ||= {}
params.each { |k, _| @params.delete(k) } unless @env['sinatra.error.params']
/usr/local/bundle/gems/sinatra-2.2.0/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
@env['sinatra.error.params'] = @params
raise
ensure
/usr/local/bundle/gems/sinatra-2.2.0/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
@env['sinatra.error.params'] = @params
raise
ensure
/usr/local/bundle/gems/sinatra-2.2.0/lib/sinatra/base.rb
in
block 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|
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
/usr/local/bundle/gems/sinatra-2.2.0/lib/sinatra/base.rb
in
each
block.call(result) if block_given?
end
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|
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
/usr/local/bundle/gems/sinatra-2.2.0/lib/sinatra/base.rb
in
route!
block.call(result) if block_given?
end
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|
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
/usr/local/bundle/gems/sinatra-2.2.0/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 => boom
invoke { handle_exception!(boom) }
ensure
begin
filter! :after unless env['sinatra.static_file']
rescue ::Exception => boom
/usr/local/bundle/gems/sinatra-2.2.0/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)
/usr/local/bundle/gems/sinatra-2.2.0/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)
/usr/local/bundle/gems/sinatra-2.2.0/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)
/usr/local/bundle/gems/sinatra-2.2.0/lib/sinatra/base.rb
in
dispatch!
# Avoid passing frozen string in force_encoding
@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 => boom
/usr/local/bundle/gems/sinatra-2.2.0/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
/usr/local/bundle/gems/sinatra-2.2.0/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)
/usr/local/bundle/gems/sinatra-2.2.0/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)
/usr/local/bundle/gems/sinatra-2.2.0/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)
/usr/local/bundle/gems/sinatra-2.2.0/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
/usr/local/bundle/gems/sinatra-2.2.0/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
/usr/local/bundle/gems/rack-protection-2.2.0/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
/usr/local/bundle/gems/rack-protection-2.2.0/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)
encoding = path.encoding
dot = '.'.encode(encoding)
/usr/local/bundle/gems/rack-protection-2.2.0/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]
/usr/local/bundle/gems/rack-protection-2.2.0/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
/usr/local/bundle/gems/rack-protection-2.2.0/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
/usr/local/bundle/gems/rack-protection-2.2.0/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
/usr/local/bundle/gems/rack-2.2.3/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
/usr/local/bundle/gems/rack-2.2.3/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
]
/usr/local/bundle/gems/sinatra-2.2.0/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
/usr/local/bundle/gems/sinatra-2.2.0/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, 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
/usr/local/bundle/gems/sinatra-2.2.0/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
/usr/local/bundle/gems/sinatra-2.2.0/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
/usr/local/bundle/gems/sinatra-2.2.0/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
/usr/local/bundle/gems/sinatra-2.2.0/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
/usr/local/bundle/gems/rack-2.2.3/lib/rack/handler/webrick.rb
in
service
env[QUERY_STRING] ||= ""
unless env[PATH_INFO] == ""
path, n = req.request_uri.path, env[SCRIPT_NAME].length
env[PATH_INFO] = path[n, path.length - n]
end
env[REQUEST_PATH] ||= [env[SCRIPT_NAME], env[PATH_INFO]].join
status, headers, body = @app.call(env)
begin
res.status = status.to_i
io_lambda = nil
headers.each { |k, vs|
if k == RACK_HIJACK
io_lambda = vs
elsif k.downcase == "set-cookie"
/usr/local/bundle/gems/webrick-1.7.0/lib/webrick/httpserver.rb
in
service
servlet, options, script_name, path_info = search_servlet(req.path)
raise HTTPStatus::NotFound, "`#{req.path}' not found." unless servlet
req.script_name = script_name
req.path_info = path_info
si = servlet.get_instance(self, *options)
@logger.debug(format("%s is invoked.", si.class.name))
si.service(req, res)
end
##
# The default OPTIONS request handler says GET, HEAD, POST and OPTIONS
# requests are allowed.
def do_OPTIONS(req, res)
/usr/local/bundle/gems/webrick-1.7.0/lib/webrick/httpserver.rb
in
run
if callback = server[:RequestCallback]
callback.call(req, res)
elsif callback = server[:RequestHandler]
msg = ":RequestHandler is deprecated, please use :RequestCallback"
@logger.warn(msg)
callback.call(req, res)
end
server.service(req, res)
rescue HTTPStatus::EOFError, HTTPStatus::RequestTimeout => ex
res.set_error(ex)
rescue HTTPStatus::Error => ex
@logger.error(ex.message)
res.set_error(ex)
rescue HTTPStatus::Status => ex
res.status = ex.code
/usr/local/bundle/gems/webrick-1.7.0/lib/webrick/server.rb
in
block in start_thread
rescue Errno::ECONNRESET, Errno::ECONNABORTED,
Errno::EPROTO, Errno::EINVAL
Thread.exit
end
end
end
call_callback(:AcceptCallback, sock)
block ? block.call(sock) : run(sock)
rescue Errno::ENOTCONN
@logger.debug "Errno::ENOTCONN raised"
rescue ServerError => ex
msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
@logger.error msg
rescue Exception => ex
@logger.error ex
No GET data.
No POST data.
Variable | Value |
---|---|
GATEWAY_INTERFACE | CGI/1.1 |
HTTP_ACCEPT | */* |
HTTP_CONNECTION | close |
HTTP_HOST | 127.0.0.1:8703 |
HTTP_USER_AGENT | claudebot |
HTTP_VERSION | HTTP/1.1 |
PATH_INFO | /Sn%C3%A4g%C3%A4rill%C3%A4.md/0f43576788502fd31f8cfc84c9d21198fa8455be |
QUERY_STRING | |
REMOTE_ADDR | 172.17.0.1 |
REMOTE_HOST | 172.17.0.1 |
REQUEST_METHOD | GET |
REQUEST_PATH | /Sn%C3%A4g%C3%A4rill%C3%A4.md/0f43576788502fd31f8cfc84c9d21198fa8455be |
REQUEST_URI | http://127.0.0.1:8703/Sn%C3%A4g%C3%A4rill%C3%A4.md/0f43576788502fd31f8cfc84c9d21198fa8455be |
SCRIPT_NAME | |
SERVER_NAME | 127.0.0.1 |
SERVER_PORT | 8703 |
SERVER_PROTOCOL | HTTP/1.1 |
SERVER_SOFTWARE | WEBrick/1.7.0 (Ruby/2.7.6/2022-04-12) |
rack.errors | #<Object:0x0000007fa48e6038> |
rack.hijack | #<Proc:0x0000007f9e985148 /usr/local/bundle/gems/rack-2.2.3/lib/rack/handler/webrick.rb:83 (lambda)> |
rack.hijack? | true |
rack.hijack_io | nil |
rack.input | #<StringIO:0x0000007f9e9851c0> |
rack.logger | #<Rack::NullLogger:0x0000007fa3c382c8 @app=#<Rack::Protection::FrameOptions:0x0000007fa3c38520 @app=#<Rack::Protection::HttpOrigin:0x0000007fa3c38818 @app=#<Rack::Protection::IPSpoofing:0x0000007fa3c38a48 @app=#<Rack::Protection::JsonCsrf:0x0000007fa3c38c28 @app=#<Rack::Protection::PathTraversal:0x0000007fa3c38e08 @app=#<Rack::Protection::XSSHeader:0x0000007fa3c391a0 @app=#<Precious::App:0x0000007fa381e0c0 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Tilt::Cache:0x0000007fa381df58 @cache={[:mustache, :layout]=>Precious::Views::Layout, [:mustache, :page]=>Precious::Views::Page, [:mustache, :error]=>Precious::Views::Error, [:mustache, :commit]=>Precious::Views::Commit, [:mustache, :latest_changes]=>Precious::Views::LatestChanges, [:mustache, :history]=>Precious::Views::History, [:mustache, :overview]=>Precious::Views::Overview, [:mustache, :search]=>Precious::Views::Search}>, @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'", :without_session=>true}>, @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=>true}>, @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=>true}>, @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=>true}>, @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=>true}>, @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=>true}, @frame_options="SAMEORIGIN">> |
rack.multiprocess | false |
rack.multithread | true |
rack.request.cookie_hash | {} |
rack.request.query_hash | {} |
rack.request.query_string | |
rack.run_once | false |
rack.url_scheme | http |
rack.version | [1, 3] |
sinatra.accept | [#<Sinatra::Request::AcceptEntry:0x0000007f9e976df0 @entry="*/*", @type="*/*", @params={}, @q=1.0>] |
sinatra.error | #<Rugged::OdbError: object not found - no match for id (0f43576788502fd31f8cfc84c9d21198fa8455be)> |
sinatra.error.params | {"captures"=>["Snägärillä.md", "0f43576788502fd31f8cfc84c9d21198fa8455be"]} |
sinatra.route | GET \/(.+?)\/([0-9a-f]{40}) |
You're seeing this error because you have
enabled the show_exceptions
setting.