Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/webrick/test_filehandler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@ def test_short_filename
end

def test_cjk_in_path
if Encoding.default_external == Encoding.find('US-ASCII')
reset_encoding = true
verb = $VERBOSE
$VERBOSE = false
Encoding.default_external = Encoding.find('UTF-8')
end

Dir.mktmpdir("\u3042") do |dir|
File.write("#{dir}/\u3042.txt", "test_cjk_in_path")
config = { :DocumentRoot => dir }
Expand All @@ -300,6 +307,11 @@ def test_cjk_in_path
http.request(req){|res| assert_equal("200", res.code, log.call) }
end
end
ensure
if reset_encoding
Encoding.default_external = Encoding.find('US-ASCII')
$VERBOSE = verb
end
end

def test_script_disclosure
Expand Down