Req #64723 [Opn->Wfx]: Set default value for CURLOPT_USERAGENT

From: Date: Sun, 24 Apr 2016 03:21:50 +0000
Subject: Req #64723 [Opn->Wfx]: Set default value for CURLOPT_USERAGENT
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200731@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64723&edit=1

 ID:                 64723
 Updated by:         pierrick@php.net
 Reported by:        dr_mantis at regad dot org
 Summary:            Set default value for CURLOPT_USERAGENT
-Status:             Open
+Status:             Wont fix
 Type:               Feature/Change Request
 Package:            cURL related
 Operating System:   N/A
 PHP Version:        5.4.14
 Block user comment: N
 Private report:     N

 New Comment:

I don't see any good reason to add a default user agent. You can easily add one if needed.


Previous Comments:
------------------------------------------------------------------------
[2014-03-05 20:59:33] narf at devilix dot net

-1

This would be a BC break and those are not nice ...
Plus, I see no reason why I should be forced to explicitly set the user-agent to an empty one.

------------------------------------------------------------------------
[2013-04-26 14:56:53] dr_mantis at regad dot org

Description:
------------
When calling curl from command-line, unless specified otherwise it sets by default the User Agent to
'curl/x.y.z'.

It would be nice if the php curl extension did the same thing (at the moment, the user agent is set
to blank), to avoid having to do something like

$v = curl_version();
curl_setopt( $curl, CURLOPT_USERAGENT, 'curl/' . $v['version'] );

Test script:
---------------
$ curl localhost

==> access.log
::1 - - [26/Apr/2013:16:54:52 +0200] "GET / HTTP/1.1" 200 1665 "-"
"curl/7.27.0"

$ php -a
php > $c = curl_init('localhost');
php > curl_exec($c);

==> access.log
::1 - - [26/Apr/2013:16:53:15 +0200] "GET / HTTP/1.1" 200 1665 "-" "-"




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=64723&edit=1


Thread (3 messages)

« previous php.bugs (#200731) next »