Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8a15872
[chore] Remove pre Rack 2.2 parameter type error compatibility logic
chadlwilson Aug 19, 2025
7f7627e
[chore] Remove deprecated LazyEnv and Env types
chadlwilson Aug 19, 2025
e0e1971
[chore] Remove unnecessary/unused ErrorApp logic
chadlwilson Aug 19, 2025
ac5feb4
[chore] Drop undocumented & deprecated config properties from jruby-r…
chadlwilson Aug 19, 2025
5ef91ef
[chore] Drop deprecated JRuby::Rack::RailsFileSystemLayout alias for …
chadlwilson Aug 19, 2025
0488671
[chore] Drop deprecated `JRuby::Rack::Errors` alias for `JRuby::Rack:…
chadlwilson Aug 19, 2025
e6cf900
[chore] Drop deprecated `jruby.rack.ignore.env` property, replaced lo…
chadlwilson Aug 19, 2025
24d7275
[chore] Clarify reason for Servlet API deprecations
chadlwilson Aug 19, 2025
7108378
[chore] Drop/rename long-deprecated methods from Java API
chadlwilson Aug 19, 2025
60892e3
[chore] Remove pre Rack 2.2 backward compat code on ::Rack::Mime
chadlwilson Aug 19, 2025
05dd389
[build] Remove early JRuby/rubygems backward compat code
chadlwilson Aug 19, 2025
d47e402
[chore] Use non-deprecated constant to determine Rack presence and de…
chadlwilson Aug 19, 2025
36c3118
[test] Test bundler rack installs with supported Rack version
chadlwilson Aug 19, 2025
35bc6cc
[chore] Remove use of deprecated JRuby 9.3 cat19 function
chadlwilson Aug 19, 2025
15e4a87
[chore] Remove JRuby < 1.7 backward compatibility logic
chadlwilson Aug 22, 2025
6cf3008
[test] Remove Ruby < 1.9 backward compatibility logic
chadlwilson Aug 22, 2025
53a6629
[test] Remove old Rubygems code not needed with integrated bundler
chadlwilson Aug 22, 2025
676f521
[test] Remove old servlet API < 3 support code
chadlwilson Aug 22, 2025
3decde1
[chore] Remove use of deprecated JRuby visitAll signature
chadlwilson Aug 22, 2025
f5e390c
[chore] Fix deprecated use of Java API
chadlwilson Aug 22, 2025
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
17 changes: 11 additions & 6 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
- Drop unnecessary `jruby.compat.version` and `RackConfig.getCompatVersion()` API
- Drop JMS support
- Drop deprecated `RackLogger` string (level) constants
- Drop `jruby.rack.jruby.version` and `jruby.rack.rack.release` keys from rack `env` Hhsh
- Drop `jruby.rack.jruby.version` and `jruby.rack.rack.release` keys from rack `env` Hash
- Drop deprecated `Rack::Handler::Servlet::Env` and `Rack::Handler::Servlet::LazyEnv` types (replaced by `DefaultEnv`)
- Drop undocumented and deprecated jruby-rack 1.0 backwards compat properties `jruby.runtime.timeout.sec`, `jruby.runtime.initializer.threads`, `jruby.init.serial`, `jruby.rack.request.size.threshold.bytes`
- Drop deprecated `jruby.rack.ignore.env` property, replaced long ago by `jruby.runtime.env` and optional `jruby.runtime.env.rubyopt`
- Drop deprecated `JRuby::Rack::RailsFileSystemLayout` alias for `JRuby::Rack::FileSystemLayout`
- Drop deprecated `JRuby::Rack::Errors` alias for `JRuby::Rack::ErrorApp`
- Drop deprecated `org.jruby.rack.RackInput` alias for `org.jruby.rack.ext.Input` class
- Drop/rename deprecated `RackConfig` and `ServletRackEnvironment` API methods per their earlier comments
- Change context listener to throw, in case of an exception during initialization, by default
- Change rails context listener to assume a thread-safe application by default
- update (bundled) rack to 2.2.17
- Fix Rails 7.1 CSRF protection when working with `JavaServletStore` sessions

## 1.2.4 (UNRELEASED)
## 1.2.4

- update (bundled) rack to 2.2.17
- Fix Rails 7.1 CSRF protection when working with `JavaServletStore` sessions
Expand Down Expand Up @@ -173,9 +178,9 @@ Changes from 1.1.15 apply since the previous release got yanked due a regression
to handle custom lazy-bound keys but can not use a default proc (#132)
- support the renew (and skip) session option with servlet store (#131)
- improve ENV isolation with booted Ruby runtimes
* jruby.rack.env replaces jruby.rack.ignore.env (now deprecated)
* jruby.runtime.env replaces jruby.rack.ignore.env (now deprecated)
* make sure RUBYOPT is ignored (with backwards compat)
* jruby.rack.env.rubyopt for finer RUBYOPT behavior control
* jruby.runtime.env.rubyopt for finer RUBYOPT behavior control
* allow env value to be specified from config
- solve the rackup "chicken - egg" problem with a plain Rack app
* with a magic comment in config.ru # rack.version: ~>1.3.6
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,9 @@ as context init parameters in web.xml or as VM-wide system properties.
- `jruby.runtime.env`: Allows to set a custom ENV hash for your Ruby environment
and thus insulate the application from the environment it is running. By setting
this option to en empty string (or 'false') it acts as if the ENV hash was
cleared out (similar to the now deprecated `jruby.rack.ignore.env` option).
- `jruby.runtime.env.rubyopt`: This option is used for compatibility with the
(deprecated) `jruby.rack.ignore.env` option since it cleared out the ENV after
RUBYOPT has been processed, by setting it to true ENV['RUBYOPT'] will be kept.
cleared out (similar to the now removed `jruby.rack.ignore.env` option).
- `jruby.runtime.env.rubyopt`: Set to true to cause ENV['RUBYOPT']
to be retained even when using `jruby.runtime.env` to override environemnt (similar to how the removed `jruby.rack.ignore.env` option behaved by default).
- `jruby.rack.logging`: Specify the logging device to use. Defaults to
`servlet_context`. See below.
- `jruby.rack.request.size.initial.bytes`: Initial size for request body memory
Expand Down
24 changes: 7 additions & 17 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,12 @@ end
desc "Unpack the rack gem"
task :unpack_gem => "target" do |t|
target = File.expand_path(t.prerequisites.first)
spec = Gem.loaded_specs['rack']
# JRuby <= 1.7.20 does not handle respond_to? with method_missing right
# ... issue with Bundler::StubSpecification wrapping (in bundler 1.10.x)
unless ( gem_file = spec.cache_file rescue nil )
#if defined?(::Bundler) && ::Bundler.const_defined?(:StubSpecification) # since Bundler 1.10.1
# spec = spec.to_spec if spec.is_a?(::Bundler::StubSpecification)
#else
# spec = spec.to_spec if spec.respond_to?(:to_spec)
#end
gem_file = File.join(spec.base_dir, 'cache', spec.file_name)
end
unless uptodate?("#{target}/vendor/rack.rb", [__FILE__, gem_file])
rack_gemfile = Gem.loaded_specs['rack'].cache_file
unless uptodate?("#{target}/vendor/rack.rb", [__FILE__, rack_gemfile])
mkdir_p "target/vendor"
require 'rubygems/installer'
rack_dir = File.basename(gem_file).sub(/\.gem$/, '')
Gem::Package.new(gem_file).extract_files("#{target}/#{rack_dir}")
rack_dir = File.basename(rack_gemfile).sub(/\.gem$/, '')
Gem::Package.new(rack_gemfile).extract_files("#{target}/#{rack_dir}")
File.open("#{target}/vendor/rack.rb", "w") do |f|
f << "dir = File.dirname(__FILE__)\n"
f << "if dir =~ /.jar!/ && dir !~ /^file:/\n"
Expand Down Expand Up @@ -187,9 +177,9 @@ task :gem => [target_jar, target_jruby_rack, target_jruby_rack_version] do
gem.homepage = %q{http://jruby.org}
gem.required_ruby_version = '>= 3.1.0' # JRuby >= 9.4
end
defined?(Gem::Builder) ? Gem::Builder.new(gemspec).build : begin
require 'rubygems/package'; Gem::Package.build(gemspec)
end

require 'rubygems/package'
Gem::Package.build(gemspec)
File.open('jruby-rack.gemspec', 'w') { |f| f << gemspec.to_ruby }
mv FileList['*.gem'], '..'
end
Expand Down
5 changes: 2 additions & 3 deletions examples/servers/Apache-Tomcat-6-0-14.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jruby.home: file:/Users/nicksieger/Projects/java/apache-tomcat-6.0.14/webapps/si
--- Context Init Parameters:
ENV_HOST = Vanguard.local
ENV_OUTPUT = /Users/nicksieger/Projects/ruby/jruby-rack/examples/servers
jruby.rack.ignore.env = true
jruby.runtime.env = false
public.root = /
rack.env = production

Expand All @@ -33,8 +33,7 @@ Settings:
compat_version =
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = true
initial_runtimes =
initial_runtimes =
logger = org.jruby.rack.logging.ServletContextLogger@7a14b43d
logger_class_name = servlet_context
logger_name = jruby.rack
Expand Down
4 changes: 1 addition & 3 deletions examples/servers/Apache-Tomcat-7-0-2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ jruby.home: file:/Users/nicksieger/Projects/java/apache-tomcat-7.0.2/webapps/sin
--- Context Init Parameters:
ENV_HOST = Vanguard.local
ENV_OUTPUT = /Users/nicksieger/Projects/ruby/jruby-rack/examples/servers
jruby.rack.ignore.env = true
public.root = /
rack.env = production

Expand All @@ -33,8 +32,7 @@ Settings:
compat_version =
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = true
initial_runtimes =
initial_runtimes =
logger = org.jruby.rack.logging.ServletContextLogger@398a3257
logger_class_name = servlet_context
logger_name = jruby.rack
Expand Down
5 changes: 2 additions & 3 deletions examples/servers/GlassFish-v3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ENV_HOST = Vanguard.local
ENV_OUTPUT = /Users/nicksieger/Projects/ruby/jruby-rack/examples/servers
com.sun.faces.forceLoadConfiguration = true
com.sun.faces.validateXml = true
jruby.rack.ignore.env = true
jruby.runtime.env = false
public.root = /
rack.env = production

Expand All @@ -35,8 +35,7 @@ Settings:
compat_version =
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = true
initial_runtimes =
initial_runtimes =
logger = org.jruby.rack.logging.ServletContextLogger@46ee45a5
logger_class_name = servlet_context
logger_name = jruby.rack
Expand Down
4 changes: 1 addition & 3 deletions examples/servers/JBoss-Web-2-1-3-GA.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ENV_HOST = Vanguard.local
ENV_OUTPUT = /Users/nicksieger/Projects/ruby/jruby-rack/examples/servers
com.sun.faces.duplicateJARPattern = ^tmp\d+(\S*\.jar)
com.sun.faces.injectionProvider = org.jboss.web.jsf.integration.injection.JBossDelegatingInjectionProvider
jruby.rack.ignore.env = true
public.root = /
rack.env = production

Expand All @@ -35,8 +34,7 @@ Settings:
compat_version =
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = true
initial_runtimes =
initial_runtimes =
logger = org.jruby.rack.logging.ServletContextLogger@1a20433b
logger_class_name = servlet_context
logger_name = jruby.rack
Expand Down
5 changes: 2 additions & 3 deletions examples/servers/JBoss-Web-3-0-0-CR1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jruby.home: classpath:/META-INF/jruby.home
--- Context Init Parameters:
ENV_HOST = Vanguard.local
ENV_OUTPUT = /Users/nicksieger/Projects/ruby/jruby-rack/examples/servers
jruby.rack.ignore.env = true
jruby.runtime.env = false
public.root = /
rack.env = production
resteasy.unwrapped.exceptions = javax.ejb.EJBException
Expand All @@ -34,8 +34,7 @@ Settings:
compat_version =
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = true
initial_runtimes =
initial_runtimes =
logger = org.jruby.rack.logging.ServletContextLogger@7ee18d93
logger_class_name = servlet_context
logger_name = jruby.rack
Expand Down
5 changes: 2 additions & 3 deletions examples/servers/Resin-4-0-13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jruby.home: file:/Users/nicksieger/Projects/java/resin-4.0.13/webapps/sinatra/WE
--- Context Init Parameters:
ENV_HOST = Vanguard.local
ENV_OUTPUT = /Users/nicksieger/Projects/ruby/jruby-rack/examples/servers
jruby.rack.ignore.env = true
jruby.runtime.env = false
public.root = /
rack.env = production

Expand All @@ -33,8 +33,7 @@ Settings:
compat_version =
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = true
initial_runtimes =
initial_runtimes =
logger = org.jruby.rack.logging.ServletContextLogger@6c538793
logger_class_name = servlet_context
logger_name = jruby.rack
Expand Down
5 changes: 2 additions & 3 deletions examples/servers/Winstone-Servlet-Engine-v0-9-10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jruby.home: file:/private/var/folders/1j/pj33xy610ms4jxbv3g0zh9400000gn/T/winsto
--- Context Init Parameters:
ENV_HOST = Vanguard.local
ENV_OUTPUT = /Users/nicksieger/Projects/ruby/jruby-rack/examples/servers
jruby.rack.ignore.env = true
jruby.runtime.env = false
public.root = /
rack.env = production

Expand All @@ -34,8 +34,7 @@ Settings:
compat_version =
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = true
initial_runtimes =
initial_runtimes =
logger = org.jruby.rack.logging.ServletContextLogger@397af435
logger_class_name = servlet_context
logger_name = jruby.rack
Expand Down
5 changes: 2 additions & 3 deletions examples/servers/jetty-6-1-25.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jruby.home: file:/private/tmp/Jetty_0_0_0_0_8080_sinatra.war__sinatra__86inrb/we
--- Context Init Parameters:
ENV_HOST = Vanguard.local
ENV_OUTPUT = /Users/nicksieger/Projects/ruby/jruby-rack/examples/servers
jruby.rack.ignore.env = true
jruby.runtime.env = false
org.mortbay.jetty.webapp.NoTLDJarPattern = start.jar|ant-.*\.jar|dojo-.*\.jar|jetty-.*\.jar|jsp-api-.*\.jar|junit-.*\.jar|servlet-api-.*\.jar|dnsns\.jar|rt\.jar|jsse\.jar|tools\.jar|sunpkcs11\.jar|sunjce_provider\.jar|xerces.*\.jar
public.root = /
rack.env = production
Expand All @@ -34,8 +34,7 @@ Settings:
compat_version =
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = true
initial_runtimes =
initial_runtimes =
logger = org.jruby.rack.logging.ServletContextLogger@1303368e
logger_class_name = servlet_context
logger_name = jruby.rack
Expand Down
5 changes: 2 additions & 3 deletions examples/servers/jetty-7-1-6-v20100715.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jruby.home: file:/private/var/folders/1j/pj33xy610ms4jxbv3g0zh9400000gn/T/Jetty_
--- Context Init Parameters:
ENV_HOST = Vanguard.local
ENV_OUTPUT = /Users/nicksieger/Projects/ruby/jruby-rack/examples/servers
jruby.rack.ignore.env = true
jruby.runtime.env = false
public.root = /
rack.env = production

Expand All @@ -33,8 +33,7 @@ Settings:
compat_version =
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = true
initial_runtimes =
initial_runtimes =
logger = org.jruby.rack.logging.ServletContextLogger@773fc437
logger_class_name = servlet_context
logger_name = jruby.rack
Expand Down
2 changes: 1 addition & 1 deletion examples/sinatra/config/warble.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
require 'socket'
config.webxml.ENV_OUTPUT = File.expand_path('../../servers', __FILE__)
config.webxml.ENV_HOST = Socket.gethostname
config.webxml.jruby.rack.ignore.env = true
config.webxml.jruby.runtime.env = false
end
22 changes: 1 addition & 21 deletions src/main/java/org/jruby/rack/AbstractFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public final void doFilter(
// NOTE: should be moved bellow, just before getDispatcher().process(...)
RackResponseEnvironment responseEnv = new ServletRackResponseEnvironment(httpResponse);

if (isDoDispatch(requestCapture, responseCapture, chain, env, responseEnv)) {
if (isDoDispatch(requestCapture, responseCapture, chain, env)) {
getDispatcher().process(env, responseEnv);
}

Expand Down Expand Up @@ -99,26 +99,6 @@ protected boolean isDoDispatch(
return true;
}

/**
* @deprecated use {@link #isDoDispatch(RequestCapture, ResponseCapture, FilterChain, RackEnvironment)}
* @param request the request
* @param response the response
* @param chain the FilterChain
* @param env the RackEnvironent
* @param responseEnv the RackResponseEnvironment
* @return isDoDispatch
* @throws IOException if there's an IO exception
* @throws ServletException if there's a servlet exception
*/
@Deprecated
protected boolean isDoDispatch(
RequestCapture request, ResponseCapture response,
FilterChain chain, RackEnvironment env,
RackResponseEnvironment responseEnv)
throws IOException, ServletException {
return isDoDispatch(request, response, chain, env);
}

/**
* Extension point if you'll need to customize {@link RequestCapture}
* @param request the request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public void initRuntime(final Ruby runtime) {
/**
* Checks and sets the required Rack version (if specified as a magic comment).
*
* e.g. # rack.version: =1.3.6
* e.g. # rack.version: =2.2.0
*
* @apiNote Internal API, only visible due tests.
*
Expand Down
Loading