With Gerrit change 174200,[1] an HTTP header "Api-User-Agent" header will be recognized for logging from the API. This should benefit clients using XMLHttpRequest where the normal User-Agent header is locked down by the browser. The logged agent will be the concatenation of Api-User-Agent and the browser's User-Agent header.
This should come in handy once the ApiFeatureUsage extension[2][3] is reviewed and deployed.
The new header will be recognized starting with 1.25wmf10, see https://www.mediawiki.org/wiki/MediaWiki_1.25/Roadmap for the schedule. It will be ignored for wikis still on 1.25wmf8 or 1.25wmf9, so feel free to upgrade any scripts immediately. Bots and other clients that have full control over the User-Agent header should continue to use that header exclusively.
[1]: https://gerrit.wikimedia.org/r/#/c/174200/ [2]: https://www.mediawiki.org/wiki/Extension:ApiFeatureUsage [3]: https://www.mediawiki.org/wiki/API/Architecture_work/Planning#Deprecated_API...
Brad Jorsch (Anomie <bjorsch <at> wikimedia.org> writes:
With Gerrit change 174200,[1] an HTTP header "Api-User-Agent" header will
be recognized for logging from the API. This should benefit clients using XMLHttpRequest where the normal User-Agent header is locked down by the browser. The logged agent will be the concatenation of Api-User-Agent and the browser's User-Agent header.
There doesn't seem to be any mechanism to set Access-Control-Allow-Headers accordingly for cross-site requests.
On Thu, Nov 27, 2014 at 7:35 PM, Gergo Tisza gtisza@gmail.com wrote:
Brad Jorsch (Anomie <bjorsch <at> wikimedia.org> writes:
With Gerrit change 174200,[1] an HTTP header "Api-User-Agent" header will
be recognized for logging from the API. This should benefit clients using XMLHttpRequest where the normal User-Agent header is locked down by the browser. The logged agent will be the concatenation of Api-User-Agent and the browser's User-Agent header.
There doesn't seem to be any mechanism to set Access-Control-Allow-Headers accordingly for cross-site requests.
Good catch. Tracked as https://phabricator.wikimedia.org/T76340
mediawiki-api@lists.wikimedia.org