Merge pull request #12544 from nupplaphil/bug/redirect

Fix redirects
This commit is contained in:
Michael Vogel 2022-12-27 21:04:02 +01:00 committed by GitHub
commit 59268c600c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -243,6 +243,14 @@ abstract class BaseModule implements ICanHandleRequests
$this->response->addContent($arr['content']);
$this->response->addContent($this->content($request));
} catch (HTTPException $e) {
// In case of System::externalRedirects(), we don't want to prettyprint the exception
// just redirect to the new location
if (($e instanceof HTTPException\FoundException) ||
($e instanceof HTTPException\MovedPermanentlyException) ||
($e instanceof HTTPException\TemporaryRedirectException)) {
throw $e;
}
$this->response->addContent($httpException->content($e));
} finally {
$this->profiler->set(microtime(true) - $timestamp, 'content');