Page MenuHomePhabricator

RESTBase passes through the user-agent
Closed, DeclinedPublic

Description

It seems like currently, RESTBase passes through the User-Agent header while making internal requests, so, for example, Mediawiki API reports requests from RESTBase, but initiated by ChangeProp as Change-Propagation (WMF). I'm not sure if this is desired behavior, but it's confusing.

It might be useful to know what user-agent originated the chain of requests, but that should be done either by matching the request-id, or by providing a new header, like X-Client-User-Agent or X-Api-User-Agent, but RESTBase should reset the user-agent to itself when making internal requests.

Event Timeline

Api-User-Agent already exists as a header, augmenting User-Agent for XHR requests from browsers where the agent can't be changed.

Possibly Restbase should directly augment the user agent rather than either replacing it or passing it through unchanged.