mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-16 03:42:41 +01:00
a823654be0
Summary: Fixes T5646. Makes diffusion a much better user experience. Users now see a 404 exception page when they have a bad URI. Previously, they saw a developer-facing raw exception. Test Plan: played around in diffusion a bunch. most of these changes were fairly mechanical at the end of the day. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T5646 Differential Revision: https://secure.phabricator.com/D11299
17 lines
670 B
PHP
17 lines
670 B
PHP
<?php
|
|
|
|
final class DiffusionRepositoryDefaultController extends DiffusionController {
|
|
|
|
protected function processDiffusionRequest(AphrontRequest $request) {
|
|
// NOTE: This controller is just here to make sure we call
|
|
// willBeginExecution() on any /diffusion/X/ URI, so we can intercept
|
|
// `git`, `hg` and `svn` HTTP protocol requests.
|
|
|
|
// If we made it here, it's probably because the user copy-pasted a
|
|
// clone URI with "/anything.git" at the end into their web browser.
|
|
// Send them to the canonical repository URI.
|
|
|
|
return id(new AphrontRedirectResponse())
|
|
->setURI($this->getDiffusionRequest()->getRepository()->getURI());
|
|
}
|
|
}
|