Page MenuHomePhabricator

Don't use fake user agent
Closed, ResolvedPublic

Description

GWToolset should really use a proper user-agent, not some copy paste that is very much not what is doing the request.

I'm not sure there's much need for it to be configurable either, but that's another story

public static $http_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1';

For example, ForeignAPIRequest uses:

public static function getUserAgent() {

		return Http::userAgent() . " ForeignAPIRepo/" . self::VERSION;

}

And for Squid purging:

$request[] = "User-Agent: " . Http::userAgent() . ' ' . CLASS;

Try something like: Http::userAgent() . " GWToolset/0.0.1-dev";

Though you might want to add a constant for the GWToolset version and re-use this here and in the loader file


Version: master
Severity: normal

Details

Reference
bz58651

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:33 AM
bzimport set Reference to bz58651.
bzimport added a subscriber: Unknown Object (MLST).
Reedy created this task.Dec 18 2013, 5:47 PM

Change 103561 had a related patch set uploaded by Dan-nl:
adding a more appropriate user-agent

https://gerrit.wikimedia.org/r/103561

Change 103561 merged by jenkins-bot:
adding a more appropriate user-agent

https://gerrit.wikimedia.org/r/103561

dan-nl added a comment.Jan 8 2014, 8:40 PM

sam,

the patch has been merged into the master branch and deployed to Commons.

please close this ticket if you’re satisfied with the results. if not, please
indicate what else needs to be addressed.

No feedback - Closing as per comment 3.

Gilles moved this task from Untriaged to Done on the Multimedia board.Dec 4 2014, 9:33 AM