brew vendor-gems: commit updates.
This commit is contained in:
parent
ab69719957
commit
f9facbf2b6
@ -69,7 +69,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/racc-1.6.2/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/nokogiri-1.13.10-x86_64-darwin/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubyntlm-0.6.3/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/webrick-1.7.0/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/webrick-1.8.1/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/webrobots-0.1.2/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/mechanize-2.8.5/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/method_source-1.0.0/lib")
|
||||
@ -119,7 +119,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-and-runtime-0.5.10461/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/thor-1.2.1/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/spoom-1.1.11/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/yard-0.9.28/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/yard-0.9.26/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/yard-sorbet-0.6.1/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/tapioca-0.7.3/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/warning-1.3.0/lib")
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#--
|
||||
# accesslog.rb -- Access log handling utilities
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# cgi.rb -- Yet another CGI library
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# compat.rb -- cross platform compatibility
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# config.rb -- Default configurations.
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# cookie.rb -- Cookie class
|
||||
#
|
||||
@ -92,7 +92,7 @@ module WEBrick
|
||||
# The cookie string suitable for use in an HTTP header
|
||||
|
||||
def to_s
|
||||
ret = ""
|
||||
ret = +""
|
||||
ret << @name << "=" << @value
|
||||
ret << "; " << "Version=" << @version.to_s if @version > 0
|
||||
ret << "; " << "Domain=" << @domain if @domain
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#--
|
||||
# htmlutils.rb -- HTMLUtils Module
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httpauth.rb -- HTTP access authentication
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#--
|
||||
# httpauth/authenticator.rb -- Authenticator mix-in module.
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httpauth/basicauth.rb -- HTTP basic access authentication
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httpauth/digestauth.rb -- HTTP digest access authentication
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httpauth/htdigest.rb -- Apache compatible htdigest file
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httpauth/htgroup.rb -- Apache compatible htgroup file
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httpauth/htpasswd -- Apache compatible htpasswd file
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#--
|
||||
# httpauth/userdb.rb -- UserDB mix-in module.
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httpproxy.rb -- HTTPProxy Class
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httprequest.rb -- HTTPRequest Class
|
||||
#
|
||||
@ -171,7 +171,7 @@ module WEBrick
|
||||
@accept_charset = []
|
||||
@accept_encoding = []
|
||||
@accept_language = []
|
||||
@body = ""
|
||||
@body = +""
|
||||
|
||||
@addr = @peeraddr = nil
|
||||
@attributes = {}
|
||||
@ -491,8 +491,7 @@ module WEBrick
|
||||
if @forwarded_host
|
||||
host, port = @forwarded_host, @forwarded_port
|
||||
elsif self["host"]
|
||||
pattern = /\A(#{URI::REGEXP::PATTERN::HOST})(?::(\d+))?\z/n
|
||||
host, port = *self['host'].scan(pattern)[0]
|
||||
host, port = parse_host_request_line(self["host"])
|
||||
elsif @addr.size > 0
|
||||
host, port = @addr[2], @addr[1]
|
||||
else
|
||||
@ -504,6 +503,11 @@ module WEBrick
|
||||
return URI::parse(uri.to_s)
|
||||
end
|
||||
|
||||
def parse_host_request_line(host)
|
||||
pattern = /\A(#{URI::REGEXP::PATTERN::HOST})(?::(\d+))?\z/no
|
||||
host.scan(pattern)[0]
|
||||
end
|
||||
|
||||
def read_body(socket, block)
|
||||
return unless socket
|
||||
if tc = self['transfer-encoding']
|
||||
@ -522,7 +526,7 @@ module WEBrick
|
||||
if @remaining_size > 0 && @socket.eof?
|
||||
raise HTTPStatus::BadRequest, "invalid body size."
|
||||
end
|
||||
elsif BODY_CONTAINABLE_METHODS.member?(@request_method) && !@socket.eof
|
||||
elsif BODY_CONTAINABLE_METHODS.member?(@request_method)
|
||||
raise HTTPStatus::LengthRequired
|
||||
end
|
||||
return @body
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httpresponse.rb -- HTTPResponse Class
|
||||
#
|
||||
@ -105,6 +105,11 @@ module WEBrick
|
||||
|
||||
attr_reader :sent_size
|
||||
|
||||
##
|
||||
# Set the response body proc as an streaming/upgrade response.
|
||||
|
||||
attr_accessor :upgrade
|
||||
|
||||
##
|
||||
# Creates a new HTTP response object. WEBrick::Config::HTTP is the
|
||||
# default configuration.
|
||||
@ -117,7 +122,7 @@ module WEBrick
|
||||
@status = HTTPStatus::RC_OK
|
||||
@reason_phrase = nil
|
||||
@http_version = HTTPVersion::convert(@config[:HTTPVersion])
|
||||
@body = ''
|
||||
@body = +""
|
||||
@keep_alive = true
|
||||
@cookies = []
|
||||
@request_method = nil
|
||||
@ -217,6 +222,16 @@ module WEBrick
|
||||
@keep_alive
|
||||
end
|
||||
|
||||
##
|
||||
# Sets the response to be a streaming/upgrade response.
|
||||
# This will disable keep-alive and chunked transfer encoding.
|
||||
|
||||
def upgrade!(protocol)
|
||||
@upgrade = protocol
|
||||
@keep_alive = false
|
||||
@chunked = false
|
||||
end
|
||||
|
||||
##
|
||||
# Sends the response on +socket+
|
||||
|
||||
@ -242,6 +257,14 @@ module WEBrick
|
||||
@header['server'] ||= @config[:ServerSoftware]
|
||||
@header['date'] ||= Time.now.httpdate
|
||||
|
||||
if @upgrade
|
||||
@header['connection'] = 'upgrade'
|
||||
@header['upgrade'] = @upgrade
|
||||
@keep_alive = false
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
# HTTP/0.9 features
|
||||
if @request_http_version < "1.0"
|
||||
@http_version = HTTPVersion.new("0.9")
|
||||
@ -268,11 +291,10 @@ module WEBrick
|
||||
elsif %r{^multipart/byteranges} =~ @header['content-type']
|
||||
@header.delete('content-length')
|
||||
elsif @header['content-length'].nil?
|
||||
if @body.respond_to? :readpartial
|
||||
elsif @body.respond_to? :call
|
||||
make_body_tempfile
|
||||
if @body.respond_to?(:bytesize)
|
||||
@header['content-length'] = @body.bytesize.to_s
|
||||
else
|
||||
@header['content-length'] = (@body ? @body.bytesize : 0).to_s
|
||||
@header['connection'] = 'close'
|
||||
end
|
||||
end
|
||||
|
||||
@ -332,7 +354,7 @@ module WEBrick
|
||||
|
||||
def send_header(socket) # :nodoc:
|
||||
if @http_version.major > 0
|
||||
data = status_line()
|
||||
data = status_line().dup
|
||||
@header.each{|key, value|
|
||||
tmp = key.gsub(/\bwww|^te$|\b\w/){ $&.upcase }
|
||||
data << "#{tmp}: #{check_header(value)}" << CRLF
|
||||
@ -419,7 +441,7 @@ module WEBrick
|
||||
# :stopdoc:
|
||||
|
||||
def error_body(backtrace, ex, host, port)
|
||||
@body = ''
|
||||
@body = +""
|
||||
@body << <<-_end_of_html_
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
||||
<HTML>
|
||||
@ -453,11 +475,11 @@ module WEBrick
|
||||
if @request_method == "HEAD"
|
||||
# do nothing
|
||||
elsif chunked?
|
||||
buf = ''
|
||||
buf = +''
|
||||
begin
|
||||
@body.readpartial(@buffer_size, buf)
|
||||
size = buf.bytesize
|
||||
data = "#{size.to_s(16)}#{CRLF}#{buf}#{CRLF}"
|
||||
data = +"#{size.to_s(16)}#{CRLF}#{buf}#{CRLF}"
|
||||
socket.write(data)
|
||||
data.clear
|
||||
@sent_size += size
|
||||
@ -517,14 +539,16 @@ module WEBrick
|
||||
@body.call(ChunkedWrapper.new(socket, self))
|
||||
socket.write("0#{CRLF}#{CRLF}")
|
||||
else
|
||||
size = @header['content-length'].to_i
|
||||
if @bodytempfile
|
||||
@bodytempfile.rewind
|
||||
IO.copy_stream(@bodytempfile, socket)
|
||||
else
|
||||
@body.call(socket)
|
||||
end
|
||||
@sent_size = size
|
||||
|
||||
if content_length = @header['content-length']
|
||||
@sent_size = content_length.to_i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -539,7 +563,7 @@ module WEBrick
|
||||
socket = @socket
|
||||
@resp.instance_eval {
|
||||
size = buf.bytesize
|
||||
data = "#{size.to_s(16)}#{CRLF}#{buf}#{CRLF}"
|
||||
data = +"#{size.to_s(16)}#{CRLF}#{buf}#{CRLF}"
|
||||
socket.write(data)
|
||||
data.clear
|
||||
@sent_size += size
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# https.rb -- SSL/TLS enhancement for HTTPServer
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httpserver.rb -- HTTPServer Class
|
||||
#
|
||||
@ -285,7 +285,7 @@ module WEBrick
|
||||
end
|
||||
|
||||
def normalize(dir)
|
||||
ret = dir ? dir.dup : ""
|
||||
ret = dir ? dir.dup : +""
|
||||
ret.sub!(%r|/+\z|, "")
|
||||
ret
|
||||
end
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httpservlet.rb -- HTTPServlet Utility File
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httpservlet.rb -- HTTPServlet Module
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# cgi_runner.rb -- CGI launcher.
|
||||
#
|
||||
@ -10,7 +10,7 @@
|
||||
# $IPR: cgi_runner.rb,v 1.9 2002/09/25 11:33:15 gotoyuzo Exp $
|
||||
|
||||
def sysread(io, size)
|
||||
buf = ""
|
||||
buf = +""
|
||||
while size > 0
|
||||
tmp = io.sysread(size)
|
||||
buf << tmp
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# cgihandler.rb -- CGIHandler Class
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# erbhandler.rb -- ERBHandler Class
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# filehandler.rb -- FileHandler Module
|
||||
#
|
||||
@ -481,9 +481,9 @@ module WEBrick
|
||||
elsif !namewidth or (namewidth = namewidth.to_i) < 2
|
||||
namewidth = 25
|
||||
end
|
||||
query = query.inject('') {|s, (k, v)| s << '&' << HTMLUtils::escape("#{k}=#{v}")}
|
||||
query = query.inject('') {|s, (k, v)| s << '&' << HTMLUtils::escape("#{k}=#{v}")}.dup
|
||||
|
||||
type = "text/html"
|
||||
type = +"text/html"
|
||||
case enc = Encoding.find('filesystem')
|
||||
when Encoding::US_ASCII, Encoding::ASCII_8BIT
|
||||
else
|
||||
@ -492,7 +492,7 @@ module WEBrick
|
||||
res['content-type'] = type
|
||||
|
||||
title = "Index of #{HTMLUtils::escape(req.path)}"
|
||||
res.body = <<-_end_of_html_
|
||||
res.body = +<<-_end_of_html_
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
@ -528,7 +528,7 @@ module WEBrick
|
||||
else
|
||||
dname = name
|
||||
end
|
||||
s = "<TR><TD class=\"name\"><A HREF=\"#{HTTPUtils::escape(name)}#{query if name.end_with?('/')}\">#{HTMLUtils::escape(dname)}</A></TD>"
|
||||
s = +"<TR><TD class=\"name\"><A HREF=\"#{HTTPUtils::escape(name)}#{query if name.end_with?('/')}\">#{HTMLUtils::escape(dname)}</A></TD>"
|
||||
s << "<TD class=\"mtime\">" << (time ? time.strftime("%Y/%m/%d %H:%M") : "") << "</TD>"
|
||||
s << "<TD class=\"size\">" << (size >= 0 ? size.to_s : "-") << "</TD></TR>\n"
|
||||
res.body << s
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# prochandler.rb -- ProcHandler Class
|
||||
#
|
||||
@ -40,6 +40,7 @@ module WEBrick
|
||||
end
|
||||
|
||||
alias do_POST do_GET
|
||||
alias do_PUT do_GET
|
||||
# :startdoc:
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#--
|
||||
# httpstatus.rb -- HTTPStatus Class
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# httputils.rb -- HTTPUtils Module
|
||||
#
|
||||
@ -48,6 +48,7 @@ module WEBrick
|
||||
"ai" => "application/postscript",
|
||||
"asc" => "text/plain",
|
||||
"avi" => "video/x-msvideo",
|
||||
"avif" => "image/avif",
|
||||
"bin" => "application/octet-stream",
|
||||
"bmp" => "image/bmp",
|
||||
"class" => "application/octet-stream",
|
||||
@ -65,6 +66,7 @@ module WEBrick
|
||||
"gif" => "image/gif",
|
||||
"htm" => "text/html",
|
||||
"html" => "text/html",
|
||||
"ico" => "image/x-icon",
|
||||
"jpe" => "image/jpeg",
|
||||
"jpeg" => "image/jpeg",
|
||||
"jpg" => "image/jpeg",
|
||||
@ -74,9 +76,11 @@ module WEBrick
|
||||
"lzh" => "application/octet-stream",
|
||||
"mjs" => "application/javascript",
|
||||
"mov" => "video/quicktime",
|
||||
"mp4" => "video/mp4",
|
||||
"mpe" => "video/mpeg",
|
||||
"mpeg" => "video/mpeg",
|
||||
"mpg" => "video/mpeg",
|
||||
"otf" => "font/otf",
|
||||
"pbm" => "image/x-portable-bitmap",
|
||||
"pdf" => "application/pdf",
|
||||
"pgm" => "image/x-portable-graymap",
|
||||
@ -95,8 +99,15 @@ module WEBrick
|
||||
"svg" => "image/svg+xml",
|
||||
"tif" => "image/tiff",
|
||||
"tiff" => "image/tiff",
|
||||
"ttc" => "font/collection",
|
||||
"ttf" => "font/ttf",
|
||||
"txt" => "text/plain",
|
||||
"wasm" => "application/wasm",
|
||||
"webm" => "video/webm",
|
||||
"webmanifest" => "application/manifest+json",
|
||||
"webp" => "image/webp",
|
||||
"woff" => "font/woff",
|
||||
"woff2" => "font/woff2",
|
||||
"xbm" => "image/x-xbitmap",
|
||||
"xhtml" => "text/html",
|
||||
"xls" => "application/vnd.ms-excel",
|
||||
@ -112,7 +123,7 @@ module WEBrick
|
||||
def load_mime_types(file)
|
||||
# note: +file+ may be a "| command" for now; some people may
|
||||
# rely on this, but currently we do not use this method by default.
|
||||
open(file){ |io|
|
||||
File.open(file){ |io|
|
||||
hash = Hash.new
|
||||
io.each{ |line|
|
||||
next if /^#/ =~ line
|
||||
@ -231,7 +242,7 @@ module WEBrick
|
||||
# Quotes and escapes quotes in +str+
|
||||
|
||||
def quote(str)
|
||||
'"' << str.gsub(/[\\\"]/o, "\\\1") << '"'
|
||||
+'"' << str.gsub(/[\\\"]/o, "\\\1") << '"'
|
||||
end
|
||||
module_function :quote
|
||||
|
||||
@ -495,7 +506,7 @@ module WEBrick
|
||||
# Escapes path +str+
|
||||
|
||||
def escape_path(str)
|
||||
result = ""
|
||||
result = +""
|
||||
str.scan(%r{/([^/]*)}).each{|i|
|
||||
result << "/" << _escape(i[0], UNESCAPED_PCHAR)
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#--
|
||||
# HTTPVersion.rb -- presentation of HTTP version
|
||||
#
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#--
|
||||
# log.rb -- Log Class
|
||||
#
|
||||
@ -86,15 +86,15 @@ module WEBrick
|
||||
end
|
||||
|
||||
# Shortcut for logging a FATAL message
|
||||
def fatal(msg) log(FATAL, "FATAL " << format(msg)); end
|
||||
def fatal(msg) log(FATAL, "FATAL " + format(msg)); end
|
||||
# Shortcut for logging an ERROR message
|
||||
def error(msg) log(ERROR, "ERROR " << format(msg)); end
|
||||
def error(msg) log(ERROR, "ERROR " + format(msg)); end
|
||||
# Shortcut for logging a WARN message
|
||||
def warn(msg) log(WARN, "WARN " << format(msg)); end
|
||||
def warn(msg) log(WARN, "WARN " + format(msg)); end
|
||||
# Shortcut for logging an INFO message
|
||||
def info(msg) log(INFO, "INFO " << format(msg)); end
|
||||
def info(msg) log(INFO, "INFO " + format(msg)); end
|
||||
# Shortcut for logging a DEBUG message
|
||||
def debug(msg) log(DEBUG, "DEBUG " << format(msg)); end
|
||||
def debug(msg) log(DEBUG, "DEBUG " + format(msg)); end
|
||||
|
||||
# Will the logger output FATAL messages?
|
||||
def fatal?; @level >= FATAL; end
|
||||
@ -118,7 +118,7 @@ module WEBrick
|
||||
# * Otherwise it will return +arg+.inspect.
|
||||
def format(arg)
|
||||
if arg.is_a?(Exception)
|
||||
"#{arg.class}: #{AccessLog.escape(arg.message)}\n\t" <<
|
||||
+"#{arg.class}: #{AccessLog.escape(arg.message)}\n\t" <<
|
||||
arg.backtrace.join("\n\t") << "\n"
|
||||
elsif arg.respond_to?(:to_str)
|
||||
AccessLog.escape(arg.to_str)
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# server.rb -- GenericServer Class
|
||||
#
|
||||
@ -102,7 +102,7 @@ module WEBrick
|
||||
@listeners = []
|
||||
@shutdown_pipe = nil
|
||||
unless @config[:DoNotListen]
|
||||
raise ArgumentError, "Port must an integer" unless @config[:Port].to_s == @config[:Port].to_i.to_s
|
||||
raise ArgumentError, "Port must be an integer" unless @config[:Port].to_s == @config[:Port].to_i.to_s
|
||||
|
||||
@config[:Port] = @config[:Port].to_i
|
||||
if @config[:Listen]
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# ssl.rb -- SSL/TLS enhancement for GenericServer
|
||||
#
|
||||
@ -95,18 +95,22 @@ module WEBrick
|
||||
# the issuer +cn+ and a +comment+ to be stored in the certificate.
|
||||
|
||||
def create_self_signed_cert(bits, cn, comment)
|
||||
rsa = OpenSSL::PKey::RSA.new(bits){|p, n|
|
||||
case p
|
||||
when 0; $stderr.putc "." # BN_generate_prime
|
||||
when 1; $stderr.putc "+" # BN_generate_prime
|
||||
when 2; $stderr.putc "*" # searching good prime,
|
||||
# n = #of try,
|
||||
# but also data from BN_generate_prime
|
||||
when 3; $stderr.putc "\n" # found good prime, n==0 - p, n==1 - q,
|
||||
# but also data from BN_generate_prime
|
||||
else; $stderr.putc "*" # BN_generate_prime
|
||||
end
|
||||
}
|
||||
rsa = if $VERBOSE
|
||||
OpenSSL::PKey::RSA.new(bits){|p, n|
|
||||
case p
|
||||
when 0; $stderr.putc "." # BN_generate_prime
|
||||
when 1; $stderr.putc "+" # BN_generate_prime
|
||||
when 2; $stderr.putc "*" # searching good prime,
|
||||
# n = #of try,
|
||||
# but also data from BN_generate_prime
|
||||
when 3; $stderr.putc "\n" # found good prime, n==0 - p, n==1 - q,
|
||||
# but also data from BN_generate_prime
|
||||
else; $stderr.putc "*" # BN_generate_prime
|
||||
end
|
||||
}
|
||||
else
|
||||
OpenSSL::PKey::RSA.new(bits)
|
||||
end
|
||||
cert = OpenSSL::X509::Certificate.new
|
||||
cert.version = 2
|
||||
cert.serial = 1
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# utils.rb -- Miscellaneous utilities
|
||||
#
|
||||
@ -78,7 +78,7 @@ module WEBrick
|
||||
# Generates a random string of length +len+
|
||||
def random_string(len)
|
||||
rand_max = RAND_CHARS.bytesize
|
||||
ret = ""
|
||||
ret = +""
|
||||
len.times{ ret << RAND_CHARS[rand(rand_max)] }
|
||||
ret
|
||||
end
|
||||
@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
#--
|
||||
# version.rb -- version and release date
|
||||
#
|
||||
@ -14,5 +14,5 @@ module WEBrick
|
||||
##
|
||||
# The WEBrick version
|
||||
|
||||
VERSION = "1.7.0"
|
||||
VERSION = "1.8.1"
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user