Path: blob/master/src/applications/diffusion/controller/DiffusionRepositoryDefaultController.php
12242 views
<?php12final class DiffusionRepositoryDefaultController extends DiffusionController {34public function shouldAllowPublic() {5// NOTE: We allow public access to this controller because it handles6// redirecting paths that are missing a trailing "/". We need to manually7// redirect these instead of relying on the automatic redirect because8// some VCS requests may omit the slashes. See T12035, and below, for some9// discussion.10return true;11}1213public function handleRequest(AphrontRequest $request) {14$response = $this->loadDiffusionContext();15if ($response) {16return $response;17}1819// NOTE: This controller is just here to make sure we call20// willBeginExecution() on any /diffusion/X/ URI, so we can intercept21// `git`, `hg` and `svn` HTTP protocol requests.2223// If we made it here, it's probably because the user copy-pasted a24// clone URI with "/anything.git" at the end into their web browser.25// Send them to the canonical repository URI.2627$drequest = $this->getDiffusionRequest();28$repository = $drequest->getRepository();2930return id(new AphrontRedirectResponse())31->setURI($repository->getURI());32}33}343536