[Mediawiki-api-announce] REST API to follow page redirects from April 25th

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[Mediawiki-api-announce] REST API to follow page redirects from April 25th

Gabriel Wicke-3
We are planning to enable automatic redirect following in all REST API
[1] HTML entry points on April 25th. When responding to a request for
a redirected title [2], the response headers will contain:

Status: 302
Location: <path-to-redirect-target>

For most clients, this means that their HTTP client will automatically
follow redirects, simplifying common use cases. The few clients with a
need to retrieve the redirect page content itself have two options:

1) Disable following redirects in the client. For HTML and
data-parsoid entry points, the response still includes the HTML body &
regular response headers like the ETag.

2) Send a `?redirect=false` query string parameter. This option is
recommended for browsers, which lack control over redirect behavior
for historical security reasons.

If you do have a need to avoid following redirects, you can make these
changes before the feature is enabled. Internally, we have already
done so for VisualEditor and the Mobile Content Service. See also
https://phabricator.wikimedia.org/T118548 for background & related

Let us know if you have any concerns or questions about this.


Gabriel Wicke for the Wikimedia Services Team

[1]: https://en.wikipedia.org/api/rest_v1/?doc (using en.wikipedia.org
as an example)
[2]: https://www.mediawiki.org/wiki/Help:Redirects

Mediawiki-api-announce mailing list
[hidden email]
Mediawiki-api mailing list
[hidden email]