laravel-localization icon indicating copy to clipboard operation
laravel-localization copied to clipboard

Specifying multiple slashes in URL "after domain" and "before the locale" should redirect, but instead, it ignores the slashes and loads the route.

Open bs-thomas opened this issue 6 years ago • 2 comments

Actual Behavior (a) http://www.somedomain.com/en/some/path This loads the route "some/path/" (handled by Laravel)

(b) http://www.somedomain.com///en/some/path This ALSO loads the route "some/path/" (handled by Laravel)

Expected Behavior (a) http://www.somedomain.com/en/some/path This should load the route "/some/path/" (handled by Laravel)

(b) http://www.somedomain.com///en/some/path This should get redirected to http://www.somedomain.com/en//en/some/path, (handled by laravel-localization) and then load the route "//en/some/path" (handled by Laravel)

I am working on a fix, will send a Pull Request shortly.

bs-thomas avatar Apr 07 '18 18:04 bs-thomas

Btw I also noticed that the tests do not include this case yet.

But I'm not quite sure how the unit test works. Tried looking, but couldnt quickly understand and underght schedule.

Would any kind person be able to add this test in? Thanks a bunch!!

bs-thomas avatar Apr 10 '18 02:04 bs-thomas

@mcamara Nice, thanks for the merge! Btw, do we not need any unit tests? Notice I haven't included them.

bs-thomas avatar Apr 27 '18 05:04 bs-thomas