Closed rkuntoro closed 4 years ago
In Guzzle 7 we removed a lot of these sensitive info.
Furthermore you can set your own header on constructing the client
$client = new Client([
'headers' => [ 'User-Agent' => ''],
]);
@gmponos Thanks for the info.
I know that I can set my own header, but I just have no controls over what other libraries do that we include via composer. This is especially for many integration SDKs that sends requests using Guzzle.
Any chance this can get added to v6? Unfortunately we're not using PHP 7.2 yet.
You should be able to pass a Guzzle client instance to the libraries you are using. If they don't support this, suggest they add it (and possibly send a PR to implement it).
I think we didn't implement this user agent change on Guzzle 6 because we considered it to be a breaking change.
Is there a library in particular you had in mind, that is doing this?
A few that we use and dependencies of the libraries we included:
You can certainly set the user agent header here. PSR requests let you do that.
@GrahamCampbell Thanks. I closed the issue
Description The default user agent contains some sensitive information like the versions of Guzzle, CURL, and PHP. I would like to omit this or set my own user agent.
I can control the Guzzle user agent of my app (through header option), but there are lots of composer dependencies that is out of my control.
There should be an easy way to globally set the default user agent without maintaining a fork.
Example