summaryrefslogtreecommitdiff
path: root/test/webrick
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2020-04-03 17:29:12 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-06-11 13:38:32 +0900
commite698bf1a7f06452c9509f33e865cc9797dde15b9 (patch)
treeff9285a370c387823ba37f048c9ef232d11b456c /test/webrick
parent6742fcf5531f29b1cce33ab32895513b87f3f53e (diff)
[ruby/webrick] Fix httpd error in CJK directory
[Bug #16753] https://github.com/ruby/webrick/commit/83cf440858
Diffstat (limited to 'test/webrick')
-rw-r--r--test/webrick/test_filehandler.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb
index ef56762abe..821d91b3cd 100644
--- a/test/webrick/test_filehandler.rb
+++ b/test/webrick/test_filehandler.rb
@@ -3,6 +3,7 @@ require "test/unit"
require_relative "utils.rb"
require "webrick"
require "stringio"
+require "tmpdir"
class WEBrick::TestFileHandler < Test::Unit::TestCase
def teardown
@@ -287,6 +288,18 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
end
end
+ def test_cjk_in_path
+ Dir.mktmpdir("\u3042") do |dir|
+ File.write("#{dir}/\u3042.txt", "test_cjk_in_path")
+ 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")
+ http.request(req){|res| assert_equal("200", res.code, log.call) }
+ end
+ end
+ end
+
def test_script_disclosure
return if File.executable?(__FILE__) # skip on strange file system