Page MenuHomePhabricator

Redirect `/source/x` (no slash) to `/source/x/` (canonical) when viewer is logged out and "x" is public
ClosedPublic

Authored by epriestley on Dec 20 2016, 1:42 PM.
Tags
None
Referenced Files
F18094267: D17097.diff
Thu, Aug 7, 10:02 PM
F18036055: D17097.id41124.diff
Sun, Aug 3, 1:47 AM
F17929105: D17097.id41124.diff
Jul 30 2025, 4:41 PM
F17817148: D17097.id41124.diff
Jul 25 2025, 11:19 PM
F17813072: D17097.diff
Jul 25 2025, 7:56 PM
F17801575: D17097.id41124.diff
Jul 25 2025, 7:57 AM
F17800407: D17097.id41124.diff
Jul 25 2025, 6:26 AM
F17769409: D17097.id41124.diff
Jul 23 2025, 8:40 AM
Subscribers
None

Details

Summary

Fixes T12035. Normally, the "abc" -> "abc/" redirect is handled automatically when "abc" hits a 404.

However, in this case, "source/x" does not 404. We route this to a valid controller because some VCS requests omit the slashes, then manually perform the redirect if we aren't serving a VCS request.

Allow this controller to serve public resources so we can serve the redirect to logged-out users instead of prompting them to login so they can be redirected.

Test Plan

Visited /source/x as a logged-out user, where x is a public repository.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable