mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 00:00:49 +00:00
Don't retry when etag is undefined because the page doesn't exist
Follow-up to 5d1a67757a
.
Bug: T233320
Change-Id: Ice27187862dde75c69bbdb666c0981fce94249ba
This commit is contained in:
parent
618225d4ed
commit
f3dfd98e55
|
@ -363,7 +363,9 @@
|
|||
// Adapted from RESTBase mwUtil.parseETag()
|
||||
var etagRegexp = /^(?:W\/)?"?([^"/]+)(?:\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))(?:\/([^"]+))?"?$/;
|
||||
|
||||
if ( useRestbase && (
|
||||
// `etag` is expected to be undefined when creating a new page.
|
||||
// We can detect that case by `content` being empty, and not retry.
|
||||
if ( useRestbase && resp.visualeditor.content && (
|
||||
!resp.visualeditor.etag ||
|
||||
!resp.visualeditor.etag.match( etagRegexp )
|
||||
) ) {
|
||||
|
|
Loading…
Reference in a new issue