@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

Set base-uri as User-Agent for OAuth1 and Github authentication

Summary: Closes T15848

Test Plan: Unclear.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: RhinosF1, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15848

Differential Revision: https://we.phorge.it/D25758

+4 -1
+2 -1
src/applications/auth/adapter/PhutilGitHubAuthAdapter.php
··· 55 55 $future = new HTTPSFuture($uri); 56 56 57 57 // NOTE: GitHub requires a User-Agent string. 58 - $future->addHeader('User-Agent', __CLASS__); 58 + $future->addHeader('User-Agent', 59 + PhabricatorEnv::getEnvConfig('phabricator.base-uri')); 59 60 60 61 // See T13485. Circa early 2020, GitHub has deprecated use of the 61 62 // "access_token" URI parameter.
+2
src/applications/auth/adapter/PhutilOAuth1AuthAdapter.php
··· 100 100 101 101 protected function newOAuth1Future($uri, $data = array()) { 102 102 $future = id(new PhutilOAuth1Future($uri, $data)) 103 + ->addHeader('User-Agent', 104 + PhabricatorEnv::getEnvConfig('phabricator.base-uri')) 103 105 ->setMethod('POST') 104 106 ->setSignatureMethod($this->getSignatureMethod()); 105 107