[前][次][番号順一覧][スレッド一覧]

ruby-changes:61761

From: Yusuke <ko1@a...>
Date: Thu, 18 Jun 2020 09:14:30 +0900 (JST)
Subject: [ruby-changes:61761] 2d817e0564 (master): test/webrick/test_filehandler.rb: Second try to fix the CI error

https://git.ruby-lang.org/ruby.git/commit/?id=2d817e0564

From 2d817e05649d4cc7f3be7185be4bc016ee836e07 Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Thu, 18 Jun 2020 09:11:02 +0900
Subject: test/webrick/test_filehandler.rb: Second try to fix the CI error

93e6fa1d319d19ce7fba37e4b9924862447b9f38 failed to fix the issue.
I suspect that the request path must be encoded as filesystem encoding.

diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb
index 807e96b..ffd10cc 100644
--- a/test/webrick/test_filehandler.rb
+++ b/test/webrick/test_filehandler.rb
@@ -294,7 +294,8 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/webrick/test_filehandler.rb#L294
       config = { :DocumentRoot => dir }
       TestWEBrick.start_httpserver(config) do |server, addr, port, log|
         http = Net::HTTP.new(addr, port)
-        req = Net::HTTP::Get.new("/%E3%81%82.txt")
+        filesystem_path = "\u3042".encode("filesystem").bytes.map {|b| "%%%X" % b }.join
+        req = Net::HTTP::Get.new("/#{ filesystem_path }.txt")
         http.request(req){|res| assert_equal("200", res.code, log.call + "\nFilesystem encoding is #{Encoding.find('filesystem')}") }
       end
     end
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]