Skip to content

Commit

Permalink
Merge "rest: Set context title before generating OutputPage error page"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Nov 11, 2024
2 parents b84766f + c506e32 commit 4c219f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Rest/Handler/AuthenticationHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use MediaWiki\Rest\Response as RestResponse;
use MediaWiki\Rest\StringStream;
use MediaWiki\Rest\Validator\Validator;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use Psr\Http\Message\ResponseInterface;

Expand Down Expand Up @@ -158,7 +159,11 @@ protected function errorResponse( $exception, $response = null ) {
return $response;
}

$out = RequestContext::getMain()->getOutput();
$context = RequestContext::getMain();
// T379504: Set dummy context title
$context->setTitle( Title::makeTitle( NS_SPECIAL, 'Api/Rest' ) );
$out = $context->getOutput();

$out->showErrorPage(
'mwoauth-error',
$this->getLocalizedErrorMessage( $exception )
Expand Down

0 comments on commit 4c219f0

Please sign in to comment.