Read in ASCII-8BIT to get rid of invalid encoding error
This commit is contained in:
parent
5755397064
commit
cf1ee151b1
@ -260,7 +260,7 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
|
|||||||
http = Net::HTTP.new(addr, port)
|
http = Net::HTTP.new(addr, port)
|
||||||
if windows?
|
if windows?
|
||||||
root = config[:DocumentRoot].tr("/", "\\")
|
root = config[:DocumentRoot].tr("/", "\\")
|
||||||
fname = IO.popen(%W[dir /x #{root}\\webrick_long_filename.cgi], &:read)
|
fname = IO.popen(%W[dir /x #{root}\\webrick_long_filename.cgi], encoding: "binary", &:read)
|
||||||
fname.sub!(/\A.*$^$.*$^$/m, '')
|
fname.sub!(/\A.*$^$.*$^$/m, '')
|
||||||
if fname
|
if fname
|
||||||
fname = fname[/\s(w.+?cgi)\s/i, 1]
|
fname = fname[/\s(w.+?cgi)\s/i, 1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user