mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 05:20:56 +01:00
Provide a more informative alternative to 404 on invalid shortened Phurl URL
Summary: When accessing an invalid URL on the short Phurl domain, users should see informative message Test Plan: Open URL in the previously configured Phurl short domain such as `https://www.zz.us` and see dialog with message. Open `https://www.zz.us/u/123` for a valid `U123` Phurl and access destination URL. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D14450
This commit is contained in:
parent
b315f61f49
commit
2b5bb642c0
1 changed files with 11 additions and 1 deletions
|
@ -8,6 +8,16 @@ final class PhabricatorPhurlShortURLDefaultController
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
return new Aphront404Response();
|
$dialog = $this->newDialog()
|
||||||
|
->setTitle(pht('Invalid URL'))
|
||||||
|
->appendParagraph(
|
||||||
|
pht('This domain can only be used to open URLs'.
|
||||||
|
' shortened using the Phurl application. The'.
|
||||||
|
' URL you are trying to access does not have'.
|
||||||
|
' a Phurl URL associated with it.'));
|
||||||
|
|
||||||
|
return id(new AphrontDialogResponse())
|
||||||
|
->setDialog($dialog)
|
||||||
|
->setHTTPResponseCode(404);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue