[go: up one dir, main page]

Page MenuHomePhabricator

Provide consistent error formatting for RSS/Atom feeds
Open, MediumPublic

Description

Example:

If I set $wgFeed=false and try to access:

http://tools.wikimedia.pl/~saper/y/api.php?hidebots=1&days=7&limit=50&action=feedrecentchanges&feedformat=rss

I get:

`
  HTTP/1.1 200 OK
  Date: Wed, 21 Oct 2015 12:46:14 GMT
  Server: Apache
  X-Content-Type-Options: nosniff
  MediaWiki-API-Error: feed-unavailable
  X-Frame-Options: DENY
  Content-language: pl,en
  X-UA-Compatible: IE=Edge
  Vary: Accept-Encoding,Cookie
  Expires: Thu, 01 Jan 1970 00:00:00 GMT
  Cache-Control: private, must-revalidate, max-age=0
  Content-Length: 4090
  Connection: close
  Content-Type: text/html; charset=UTF-8
`

with HTML-ized json response

`{
    "error": {
        "code": "feed-unavailable",
        "info": "Syndication feeds are not available",
        "*": "See http://tools.wikimedia.pl/~saper/y/api.php for API usage"
    }
}`

But when I try to access watchlist feed:

http://tools.wikimedia.pl/~saper/y/api.php?action=feedwatchlist&allrev=1&wlowner=WikiAdmin&wltoken=0daccf797b431d3151e6026f2e066d8cb709fad8&feedformat=rss

I get

`
  HTTP/1.1 200 OK
  Date: Wed, 21 Oct 2015 12:48:38 GMT
  Server: Apache
  X-Content-Type-Options: nosniff
  Vary: Accept-Encoding,Cookie
  Expires: Thu, 01 Jan 1970 00:00:00 GMT
  Cache-Control: private, must-revalidate, max-age=0
  Content-Length: 613
  Connection: close
  Content-Type: application/xml; charset=UTF-8
  Content-Language: pl

`

with an RSS-formatted item with an error message.

I think we should send a proper HTTP error code (403 or something like that) and the XML message that RSS readers might interpret.

Event Timeline

saper raised the priority of this task from to Medium.
saper updated the task description. (Show Details)
saper added a project: MediaWiki-Action-API.
saper added subscribers: saper, Aklapper, mgrabovsky and 6 others.
Anomie subscribed.

The main problem is that none of the feed formats has any method for actually reporting errors. You either return something that's not in the feed format or you make some sort of bogus feed-item.