Page MenuHomePhabricator

Add custom user agent to http requests
Closed, ResolvedPublic

Description

We currently make HTTP requests to:

  • get Citoid response for a target webpage from the Citoid API
  • get HTML for a target webpage, from the target's host
  • get domain configurations, from Meta API

We should add a custom user agent to this request, to help diagnose possible problems. This agent should be configurable, as mentioned in T302588

Event Timeline

diegodlh claimed this task.

Addressed both in Web2Cit-Core and Web2Cit-Server.

c53a1554 makes all outgoing requests from Web2Cit-Core have a web2cit-core/X.Y.Z user agent, and adds an option to the Domain constructor to specify a user agent prefix if needed.

7208be04 makes use of this user agent prefix option from Web2Cit-Server, adding web2cit-server/X.Y.Z (https://phabricator...) at the beginning of the user agent.