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:
Kazuhiro NISHIYAMA 2020-06-19 23:06:38 +09:00
Родитель 97c1782db6
Коммит 32e2440a66
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 262ED8DBB4222F7A
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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