rails / journey

A router for rails
221 stars 57 forks source link

Fix to not allow trailing slash on script name when matching #24

Closed carlosantoniodasilva closed 12 years ago

carlosantoniodasilva commented 12 years ago

This is related to a Rails issue with mounted engines on root path. See Rails issues:

https://github.com/rails/rails/issues/2131 https://github.com/rails/rails/issues/2230 https://github.com/rails/rails/issues/2579 https://github.com/rails/rails/issues/5342

Related, this issue added a fix for url generation with double slashes in engines, and ended up adding by mistake the same failing test case that 5342 introduces again. The failing test case was removed later, but the issue related to it still exists.

I believe this could be merged in versions for both Rails master and 3-2. Also, issue 5342 in Rails can be merged in both as well to avoid regressions, I'll add a comment there.

Let me know if something can be improved. Thanks!

carlosantoniodasilva commented 12 years ago

Btw, Rack::Lint has an assertion that SCRIPT_NAME cannot be '/', My first attempt to fix this was similar to the way they use in handlers:

env["SCRIPT_NAME"] = "" if env["SCRIPT_NAME"] == "/"
jeremy commented 12 years ago

:+1::ok_hand: