diff --git a/lib/webrick/accesslog.rb b/lib/webrick/accesslog.rb index e4849637..fccfd653 100644 --- a/lib/webrick/accesslog.rb +++ b/lib/webrick/accesslog.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true #-- # accesslog.rb -- Access log handling utilities # diff --git a/lib/webrick/cgi.rb b/lib/webrick/cgi.rb index bb0ae2fc..f22480b8 100644 --- a/lib/webrick/cgi.rb +++ b/lib/webrick/cgi.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # cgi.rb -- Yet another CGI library # diff --git a/lib/webrick/compat.rb b/lib/webrick/compat.rb index c497a193..842da1eb 100644 --- a/lib/webrick/compat.rb +++ b/lib/webrick/compat.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # compat.rb -- cross platform compatibility # diff --git a/lib/webrick/config.rb b/lib/webrick/config.rb index 9f2ab44f..d67375c8 100644 --- a/lib/webrick/config.rb +++ b/lib/webrick/config.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # config.rb -- Default configurations. # diff --git a/lib/webrick/cookie.rb b/lib/webrick/cookie.rb index 5fd3bfb2..7b187822 100644 --- a/lib/webrick/cookie.rb +++ b/lib/webrick/cookie.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # cookie.rb -- Cookie class # @@ -92,7 +92,7 @@ def expires # 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 diff --git a/lib/webrick/htmlutils.rb b/lib/webrick/htmlutils.rb index ed9f4ac0..7ff0bde2 100644 --- a/lib/webrick/htmlutils.rb +++ b/lib/webrick/htmlutils.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true #-- # htmlutils.rb -- HTMLUtils Module # diff --git a/lib/webrick/httpauth.rb b/lib/webrick/httpauth.rb index f8bf09a6..4f5321c8 100644 --- a/lib/webrick/httpauth.rb +++ b/lib/webrick/httpauth.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httpauth.rb -- HTTP access authentication # diff --git a/lib/webrick/httpauth/authenticator.rb b/lib/webrick/httpauth/authenticator.rb index 8f0eaa3a..a6ee28de 100644 --- a/lib/webrick/httpauth/authenticator.rb +++ b/lib/webrick/httpauth/authenticator.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true #-- # httpauth/authenticator.rb -- Authenticator mix-in module. # diff --git a/lib/webrick/httpauth/basicauth.rb b/lib/webrick/httpauth/basicauth.rb index 7d0a9cfc..cc8137af 100644 --- a/lib/webrick/httpauth/basicauth.rb +++ b/lib/webrick/httpauth/basicauth.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httpauth/basicauth.rb -- HTTP basic access authentication # diff --git a/lib/webrick/httpauth/digestauth.rb b/lib/webrick/httpauth/digestauth.rb index 3cf12899..25ce8ba0 100644 --- a/lib/webrick/httpauth/digestauth.rb +++ b/lib/webrick/httpauth/digestauth.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httpauth/digestauth.rb -- HTTP digest access authentication # diff --git a/lib/webrick/httpauth/htdigest.rb b/lib/webrick/httpauth/htdigest.rb index 93b18e2c..c7e853b7 100644 --- a/lib/webrick/httpauth/htdigest.rb +++ b/lib/webrick/httpauth/htdigest.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httpauth/htdigest.rb -- Apache compatible htdigest file # diff --git a/lib/webrick/httpauth/htgroup.rb b/lib/webrick/httpauth/htgroup.rb index e06c441b..108c9d0b 100644 --- a/lib/webrick/httpauth/htgroup.rb +++ b/lib/webrick/httpauth/htgroup.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httpauth/htgroup.rb -- Apache compatible htgroup file # diff --git a/lib/webrick/httpauth/htpasswd.rb b/lib/webrick/httpauth/htpasswd.rb index abca3053..9a48e57d 100644 --- a/lib/webrick/httpauth/htpasswd.rb +++ b/lib/webrick/httpauth/htpasswd.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httpauth/htpasswd -- Apache compatible htpasswd file # diff --git a/lib/webrick/httpauth/userdb.rb b/lib/webrick/httpauth/userdb.rb index 7a17715c..0d0f72b1 100644 --- a/lib/webrick/httpauth/userdb.rb +++ b/lib/webrick/httpauth/userdb.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true #-- # httpauth/userdb.rb -- UserDB mix-in module. # diff --git a/lib/webrick/httpproxy.rb b/lib/webrick/httpproxy.rb index 7607c3df..196682ec 100644 --- a/lib/webrick/httpproxy.rb +++ b/lib/webrick/httpproxy.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httpproxy.rb -- HTTPProxy Class # diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb index d34eac7e..fe95aad9 100644 --- a/lib/webrick/httprequest.rb +++ b/lib/webrick/httprequest.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httprequest.rb -- HTTPRequest Class # @@ -171,7 +171,7 @@ def initialize(config) @accept_charset = [] @accept_encoding = [] @accept_language = [] - @body = "" + @body = +"" @addr = @peeraddr = nil @attributes = {} diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb index ba4494ab..c7238dc0 100644 --- a/lib/webrick/httpresponse.rb +++ b/lib/webrick/httpresponse.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httpresponse.rb -- HTTPResponse Class # @@ -332,7 +332,7 @@ def remove_body_tempfile # :nodoc: 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 +419,7 @@ def check_header(header_value) # :stopdoc: def error_body(backtrace, ex, host, port) - @body = '' + @body = +'' @body << <<-_end_of_html_ @@ -453,11 +453,11 @@ def send_body_io(socket) 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 @@ -539,7 +539,7 @@ def write(buf) 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 diff --git a/lib/webrick/https.rb b/lib/webrick/https.rb index b0a49bc4..7f00b306 100644 --- a/lib/webrick/https.rb +++ b/lib/webrick/https.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # https.rb -- SSL/TLS enhancement for HTTPServer # diff --git a/lib/webrick/httpserver.rb b/lib/webrick/httpserver.rb index e85d0593..0d261bf0 100644 --- a/lib/webrick/httpserver.rb +++ b/lib/webrick/httpserver.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httpserver.rb -- HTTPServer Class # @@ -285,7 +285,7 @@ def compile end def normalize(dir) - ret = dir ? dir.dup : "" + ret = dir ? dir.dup : +"" ret.sub!(%r|/+\z|, "") ret end diff --git a/lib/webrick/httpservlet.rb b/lib/webrick/httpservlet.rb index da49a140..4cb1822c 100644 --- a/lib/webrick/httpservlet.rb +++ b/lib/webrick/httpservlet.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httpservlet.rb -- HTTPServlet Utility File # diff --git a/lib/webrick/httpservlet/abstract.rb b/lib/webrick/httpservlet/abstract.rb index bccb0918..6fae4de9 100644 --- a/lib/webrick/httpservlet/abstract.rb +++ b/lib/webrick/httpservlet/abstract.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # httpservlet.rb -- HTTPServlet Module # diff --git a/lib/webrick/httpservlet/cgi_runner.rb b/lib/webrick/httpservlet/cgi_runner.rb index 0398c167..b0948ae3 100644 --- a/lib/webrick/httpservlet/cgi_runner.rb +++ b/lib/webrick/httpservlet/cgi_runner.rb @@ -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 diff --git a/lib/webrick/httpservlet/cgihandler.rb b/lib/webrick/httpservlet/cgihandler.rb index 4457770b..450aa380 100644 --- a/lib/webrick/httpservlet/cgihandler.rb +++ b/lib/webrick/httpservlet/cgihandler.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # cgihandler.rb -- CGIHandler Class # diff --git a/lib/webrick/httpservlet/erbhandler.rb b/lib/webrick/httpservlet/erbhandler.rb index cd09e5f2..3b232f7f 100644 --- a/lib/webrick/httpservlet/erbhandler.rb +++ b/lib/webrick/httpservlet/erbhandler.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # erbhandler.rb -- ERBHandler Class # diff --git a/lib/webrick/httpservlet/filehandler.rb b/lib/webrick/httpservlet/filehandler.rb index 010df0e9..7ab88bca 100644 --- a/lib/webrick/httpservlet/filehandler.rb +++ b/lib/webrick/httpservlet/filehandler.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # # filehandler.rb -- FileHandler Module # @@ -481,9 +481,9 @@ def set_dir_list(req, res) 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 @@ def set_dir_list(req, res) res['content-type'] = type title = "Index of #{HTMLUtils::escape(req.path)}" - res.body = <<-_end_of_html_ + res.body = +<<-_end_of_html_
@@ -528,7 +528,7 @@ def set_dir_list(req, res) else dname = name end - s = "