Skip to content

Add Rack::Handler::Servlet::DefaultEnv#get_header #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 17, 2017

Conversation

HarlemSquirrel
Copy link
Contributor

Fixes #211

Kevin McCormack added 2 commits August 15, 2017 11:25
Add missing methods to handle ActionController::Base#reset_session
@kares
Copy link
Member

kares commented Aug 16, 2017

thanks for getting sessions working, hopefully the rest of the code-base is compatible with Rails 5.x as well :)
guess its done as is or are you planning on adding tests?

@HarlemSquirrel
Copy link
Contributor Author

I just bumped the rack version to 2.0.3 and everything is passing! I think that may be the best way to test it, no?

Without my changes there are 3 failures:

Failures:

  1) Rack::Handler::Servlet (default) env behaves like env sets attributes with false/null values
     Failure/Error: expect( env['org.false'] ).to be false
       
       expected #<FalseClass:0> => false
            got #<String:5364> => ""
       
       Compared using equal?, which compares object identity,
       but expected and actual are not the same object. Use
       `expect(actual).to eq(expected)` if you don't care about
       object identity in this example.
     Shared Example Group: "env" called from ./src/spec/ruby/rack/handler/servlet_spec.rb:819
     # ./src/spec/ruby/rack/handler/servlet_spec.rb:376:in `block in (root)'
     # org/jruby/RubyBasicObject.java:1691:in `instance_eval'
     # org/jruby/RubyArray.java:2486:in `map'
     # org/jruby/RubyArray.java:2486:in `map'
     # org/jruby/RubyArray.java:2486:in `map'
     # org/jruby/RubyArray.java:2486:in `map'

  2) Rack::Handler::Servlet lazy env behaves like env sets attributes with false/null values
     Failure/Error: expect( env['org.false'] ).to be false
       
       expected #<FalseClass:0> => false
            got #<String:5624> => ""
       
       Compared using equal?, which compares object identity,
       but expected and actual are not the same object. Use
       `expect(actual).to eq(expected)` if you don't care about
       object identity in this example.
     Shared Example Group: "env" called from ./src/spec/ruby/rack/handler/servlet_spec.rb:835
     # ./src/spec/ruby/rack/handler/servlet_spec.rb:376:in `block in (root)'
     # org/jruby/RubyBasicObject.java:1691:in `instance_eval'
     # org/jruby/RubyArray.java:2486:in `map'
     # org/jruby/RubyArray.java:2486:in `map'
     # org/jruby/RubyArray.java:2486:in `map'
     # org/jruby/RubyArray.java:2486:in `map'

  3) Rack::Handler::Servlet servlet-env behaves like env sets attributes with false/null values
     Failure/Error: expect( env['org.false'] ).to be false
       
       expected #<FalseClass:0> => false
            got #<String:5886> => ""
       
       Compared using equal?, which compares object identity,
       but expected and actual are not the same object. Use
       `expect(actual).to eq(expected)` if you don't care about
       object identity in this example.
     Shared Example Group: "env" called from ./src/spec/ruby/rack/handler/servlet_spec.rb:1000
     # ./src/spec/ruby/rack/handler/servlet_spec.rb:376:in `block in (root)'
     # org/jruby/RubyBasicObject.java:1691:in `instance_eval'
     # org/jruby/RubyArray.java:2486:in `map'
     # org/jruby/RubyArray.java:2486:in `map'
     # org/jruby/RubyArray.java:2486:in `map'
     # org/jruby/RubyArray.java:2486:in `map'

Finished in 44.82 seconds
581 examples, 3 failures, 2 pending

@kares
Copy link
Member

kares commented Aug 16, 2017

OK, thanks. Yes the bump is a good preliminary test.
Wasn't sure how well your changes are tested esp. in relation to the session store ...

However, for 1.1.x line we should not update the (bundled) rack version, unsure of Rack 2.0's details but tests are likely no where near testing it our for real on a servlet container. So the version bump should get reverted.

This reverts commit d25dd89.
@HarlemSquirrel
Copy link
Contributor Author

That makes sense. I've added a revert commit. All seems to be well with Rails 5.1.3 and JRuby 9.1.12.0 just so you know!

@kares
Copy link
Member

kares commented Aug 17, 2017

looking good, thank you! 1.1 release hopefully next week or so ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants