-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Rails Routing Contraints with 9.1.3.0 #4124
Comments
Thank you for the repro! Looking into it now. |
Well I can reproduce, so that's good. Removing the constrained route or moving it second allows |
After a bit of hunting I managed to see that it's basically registering the list-constrained route twice. find_routes on 9.1.3.0:
find_routes on 9.1.2.0:
|
And after a bit more hunting, we have our reduced repro:
The And the fix is equally trivial: diff --git a/core/src/main/java/org/jruby/specialized/RubyArrayTwoObject.java b/core/src/main/java/org/jruby/specialized/RubyArrayTwoObject.java
index d38bb89..e24f6df 100644
--- a/core/src/main/java/org/jruby/specialized/RubyArrayTwoObject.java
+++ b/core/src/main/java/org/jruby/specialized/RubyArrayTwoObject.java
@@ -252,7 +252,7 @@ public class RubyArrayTwoObject extends RubyArraySpecialized {
if (origArr.size() == 2) {
car = origArr.eltInternal(0);
- cdr = origArr.eltInternal(0);
+ cdr = origArr.eltInternal(1);
return this;
}
Sigh. |
I will be adding a flag to 9.1.4.0 to turn off packed arrays in case we have other issues, but we at least have this one fixed! |
👍 Thank you for addressing this (and so quickly!) |
Environment
Expected Behavior
When a rails app has routing contraints such as:
A request to "/home" does not match the constraints for the #list endpoint therefore it passes through to the #index endpoint when under Ruby 2.3.1 and JRuby 9.1.2.0. When under JRuby 9.1.3.0 the same request fails with a routing error.
You can find the repro code here https://github.com/creddy/request_contraints
Actual Behavior
Thank you
The text was updated successfully, but these errors were encountered: