mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-27 15:50:29 +00:00
ApiVisualEditor: Always return 'etag' with 'content'
For consistency, I guess. Also I need this in I2ef0ca8725. Previously, when querying the HTML content of an existing page, we did not return the 'etag', on the assumption that anyone who needs it will instead query RESTBase directly. Bug: T233320 Change-Id: I463a84de631598243893946ad1d060a9aa0b180e
This commit is contained in:
parent
dec54cf56e
commit
679e777cfa
|
@ -312,17 +312,17 @@ class ApiVisualEditor extends ApiBase {
|
|||
$response = $this->parseWikitextFragment(
|
||||
$title, $wikitext, false, $oldid, $stash
|
||||
);
|
||||
$content = $response['body'];
|
||||
$restbaseHeaders = $response['headers'];
|
||||
} else {
|
||||
$content = $this->requestRestbase(
|
||||
$response = $this->requestRestbase(
|
||||
$title,
|
||||
'GET',
|
||||
'page/html/' . urlencode( $title->getPrefixedDBkey() ) . '/' . $oldid .
|
||||
'?redirect=false&stash=true',
|
||||
[]
|
||||
)['body'];
|
||||
);
|
||||
}
|
||||
$content = $response['body'];
|
||||
$restbaseHeaders = $response['headers'];
|
||||
if ( $content === false ) {
|
||||
$this->dieWithError( 'apierror-visualeditor-docserver', 'docserver' );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue