3 final class DiffusionRepositoryDefaultController
extends DiffusionController
{
5 public function shouldAllowPublic() {
6 // NOTE: We allow public access to this controller because it handles
7 // redirecting paths that are missing a trailing "/". We need to manually
8 // redirect these instead of relying on the automatic redirect because
9 // some VCS requests may omit the slashes. See T12035, and below, for some
14 public function handleRequest(AphrontRequest
$request) {
15 $response = $this->loadDiffusionContext();
20 // NOTE: This controller is just here to make sure we call
21 // willBeginExecution() on any /diffusion/X/ URI, so we can intercept
22 // `git`, `hg` and `svn` HTTP protocol requests.
24 // If we made it here, it's probably because the user copy-pasted a
25 // clone URI with "/anything.git" at the end into their web browser.
26 // Send them to the canonical repository URI.
28 $drequest = $this->getDiffusionRequest();
29 $repository = $drequest->getRepository();
31 return id(new AphrontRedirectResponse())
32 ->setURI($repository->getURI());