Commit graph

9 commits

Author SHA1 Message Date
🙈 jacopo beschi 🙉
729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Michael Kozono
49697bc8df Refactor to more robust implementation
In order to avoid string manipulation or modify route params (to make them unambiguous for `url_for`), we are accepting a behavior change:

When being redirected to the canonical path for a group, if you requested a group show path starting with `/groups/…` then you’ll now be redirected to the group at root `/…`.
2017-05-19 09:13:27 -07:00
Michael Kozono
f9785dcec3 Fix ensure_canonical_path for top level routes
Don’t replace a substring of the path if it is part of the top level route.

E.g. When redirecting from `/groups/ups` to `/groups/foo`, be careful not to do `/grofoo/ups`.

Projects are unaffected by this issue, but I am grouping the `#ensure_canonical_path` tests similar to the group and user tests.
2017-05-18 16:24:10 -07:00
Michael Kozono
52aba709ff Fix #32506
The host should not be modified, nor is it needed for the redirect.
2017-05-18 09:36:15 -07:00
Michael Kozono
ab98f8b5b1 Fix redirect message for groups and users 2017-05-11 15:28:13 -07:00
Michael Kozono
f05469f99b Resolve discussions 2017-05-05 12:12:50 -07:00
Michael Kozono
9e48f02ea8 Dry up routable lookups. Fixes #30317
Note: This changes the behavior of user lookups (see the spec change) so it acts the same way as groups and projects. Unauthenticated clients attempting to access a user page will be redirected to login whether the user exists and is publicly restricted, or does not exist at all.
2017-05-05 12:12:50 -07:00
Michael Kozono
e4bcc90d95 Add “project moved” flash message on redirect 2017-05-05 12:12:50 -07:00
Michael Kozono
7d02bcd2e0 Redirect from redirect routes to canonical routes 2017-05-05 12:11:57 -07:00