Page MenuHomePhabricator

Edit API returns HTTP 200 over failed edit e.g. for spam blacklist
Closed, DuplicatePublic

Description

Fiddler trace (ZIP archive with a funny name)

Your extension seems to give some rather odd HTTP responses. Namely:

HTTP/1.1 200 OK
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.9+wmf1
X-Content-Type-Options: nosniff
Cache-control: private
MediaWiki-API-Error: unknownerror
X-Frame-Options: DENY
Vary: Accept-Encoding
X-Vary-Options: Accept-Encoding;list-contains=gzip
Content-Type: text/xml; charset=utf-8
X-Varnish: 675837389, 1807899246
Via: 1.1 varnish, 1.1 varnish
Content-Length: 129
Accept-Ranges: bytes
Date: Fri, 21 Feb 2014 05:16:39 GMT
Age: 0
Connection: keep-alive
X-Cache: cp1053 miss (0), cp1055 frontend miss (0)

<?xml version="1.0"?><api servedby="mw1135"><error code="unknownerror" info="Unknown error: &quot;tpt-target-page&quot;" /></api>

This was for an attempt to save "MediaWiki 1.21/wmf5/el" on www.mediawiki.org.

(Raw request/response pair attached in Fiddler's ZIP-based format; would be easiest to open in Fiddler, but anything else that understands raw HTTP request/response pairs should be able to make sense of the data.)

I'm assuming it's from this extension because it only happens on pages that, when edited from normal UI, open in your fancy translation tool.

I have two questions:

  1. Why is this a "200 OK"? Things are clearly not OK; it should probably be a 500, or possibly a 403.
  1. Why is the error so non-specific?

Version: unspecified
Severity: normal

Attached:

Details

Reference
bz61736

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 2:59 AM
bzimport set Reference to bz61736.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to Samuel Bronson from comment #0)

  1. Why is this a "200 OK"? Things are clearly not OK; it should probably be

a 500, or possibly a 403.

This is a general API thing, not specific to the Translate extension.

I just tried https://meta.wikimedia.org/w/api.php?action=edit&format=json + title=Meta%3ASandbox&appendtext=http%3A%2F%2Fbit.ly%2Fabcdef (an edit prohibited by the spam blacklist) and I get HTTP 200 too.

Nemo_bis renamed this task from Gives a completely unhelpful response to AutoWikiBrowser on save to Edit API returns HTTP 200 over failed edit e.g. for spam blacklist.Aug 17 2015, 3:52 PM
Nemo_bis set Security to None.

The task this was merged into makes no mention of HTTP 200. Does the closure mean that status 200 is fine? It would make more sense to close this as invalid, then.