ruby-changes:63075
From: Charles <ko1@a...>
Date: Thu, 24 Sep 2020 21:42:29 +0900 (JST)
Subject: [ruby-changes:63075] 46ba416a1f (master): [ruby/webrick] Skip env-locale-sensitive CGI test on the "java" platform
https://git.ruby-lang.org/ruby.git/commit/?id=46ba416a1f From 46ba416a1fa0973b56146077a654d68779c2497b Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter <headius@h...> Date: Mon, 1 Jun 2020 00:48:41 -0500 Subject: [ruby/webrick] Skip env-locale-sensitive CGI test on the "java" platform JRuby's environment variables are provided by the Java Development Kit's (JDK's) classes, which present them as a map from string to string. In order to do this, those environment variable names and values must be decoded into characters, which breaks any variables that are intended to be "raw" bytes not necessarily decodable with the default system encoding. This issue is detailed in jruby/jruby#6248. The only solution on the JRuby side will be to bypass the JDK environment variable API and go directly to the native getenv/setenv system calls. This is not likely to happen in the near future, due to the complexity of such a change and the rarity of undecodable environment values. The exclude here was added due to the Windows platform also having a similar sensitivity to character encodings when working with environment variables. It seems appropriate to expand this skip to the "java" platform, as the root issue is largely the same. https://github.com/ruby/webrick/commit/dc453e5c3c diff --git a/test/webrick/test_cgi.rb b/test/webrick/test_cgi.rb index 764c63f..7a75cf5 100644 --- a/test/webrick/test_cgi.rb +++ b/test/webrick/test_cgi.rb @@ -43,7 +43,7 @@ class TestWEBrickCGI < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/webrick/test_cgi.rb#L43 http.request(req){|res| assert_equal("/path/info", res.body, log.call)} req = Net::HTTP::Get.new("/webrick.cgi/%3F%3F%3F?foo=bar") http.request(req){|res| assert_equal("/???", res.body, log.call)} - unless RUBY_PLATFORM =~ /mswin|mingw|cygwin|bccwin32/ + unless RUBY_PLATFORM =~ /mswin|mingw|cygwin|bccwin32|java/ # Path info of res.body is passed via ENV. # ENV[] returns different value on Windows depending on locale. req = Net::HTTP::Get.new("/webrick.cgi/%A4%DB%A4%B2/%A4%DB%A4%B2") -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/