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:
Bartosz Dziewoński 2019-10-14 22:11:36 +02:00
parent dec54cf56e
commit 679e777cfa

View file

@ -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' );
}