зеркало из https://github.com/github/ruby.git
Fix `ERROR ArgumentError: invalid byte sequence in UTF-8`
http://ci.rvm.jp/results/trunk-test@ruby-sky1/3012894 ``` /tmp/ruby/v3/src/trunk-test/tool/lib/minitest/unit.rb:199:in `assert': webrick log start: (MiniTest::Assertion) [2020-06-19 23:01:59] ERROR ArgumentError: invalid byte sequence in UTF-8 /tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/filehandler.rb:336:in `scan' /tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/filehandler.rb:336:in `set_filename' /tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/filehandler.rb:310:in `exec_handler' /tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/filehandler.rb:245:in `do_GET' /tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/abstract.rb:105:in `service' /tmp/ruby/v3/src/trunk-test/lib/webrick/httpservlet/filehandler.rb:241:in `service' /tmp/ruby/v3/src/trunk-test/lib/webrick/httpserver.rb:140:in `service' /tmp/ruby/v3/src/trunk-test/lib/webrick/httpserver.rb:96:in `run' /tmp/ruby/v3/src/trunk-test/lib/webrick/server.rb:307:in `block in start_thread' ```
This commit is contained in:
Родитель
97c1782db6
Коммит
32e2440a66
|
@ -333,7 +333,7 @@ module WEBrick
|
|||
|
||||
def set_filename(req, res)
|
||||
res.filename = @root
|
||||
path_info = set_filesystem_encoding(req.path_info).scan(%r|/[^/]*|)
|
||||
path_info = req.path_info.scan(%r|/[^/]*|).map{|path| set_filesystem_encoding(path) }
|
||||
|
||||
path_info.unshift("") # dummy for checking @root dir
|
||||
while base = path_info.first
|
||||
|
|
Загрузка…
Ссылка в новой задаче