summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Auth/Yadis/HTTPFetcher.php2
-rw-r--r--Auth/Yadis/ParanoidHTTPFetcher.php3
-rw-r--r--Auth/Yadis/PlainHTTPFetcher.php2
3 files changed, 6 insertions, 1 deletions
diff --git a/Auth/Yadis/HTTPFetcher.php b/Auth/Yadis/HTTPFetcher.php
index c0eedd0..44c748e 100644
--- a/Auth/Yadis/HTTPFetcher.php
+++ b/Auth/Yadis/HTTPFetcher.php
@@ -19,6 +19,8 @@
require_once "Auth/OpenID.php";
define('Auth_OpenID_FETCHER_MAX_RESPONSE_KB', 1024);
+define('Auth_OpenID_USER_AGENT',
+ 'php-openid/'.Auth_OpenID_VERSION.' php '.phpversion());
class Auth_Yadis_HTTPResponse {
function Auth_Yadis_HTTPResponse($final_url = null, $status = null,
diff --git a/Auth/Yadis/ParanoidHTTPFetcher.php b/Auth/Yadis/ParanoidHTTPFetcher.php
index ab77a1c..a237ae5 100644
--- a/Auth/Yadis/ParanoidHTTPFetcher.php
+++ b/Auth/Yadis/ParanoidHTTPFetcher.php
@@ -117,6 +117,9 @@ class Auth_Yadis_ParanoidHTTPFetcher extends Auth_Yadis_HTTPFetcher {
curl_setopt($c, CURLOPT_HTTPHEADER, $extra_headers);
}
+ $cv = curl_version();
+ curl_setopt($c, CURLOPT_USERAGENT,
+ Auth_OpenID_USER_AGENT.' curl '.$cv['version']);
curl_setopt($c, CURLOPT_TIMEOUT, $off);
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_RANGE,
diff --git a/Auth/Yadis/PlainHTTPFetcher.php b/Auth/Yadis/PlainHTTPFetcher.php
index f61ab64..aea57ea 100644
--- a/Auth/Yadis/PlainHTTPFetcher.php
+++ b/Auth/Yadis/PlainHTTPFetcher.php
@@ -69,7 +69,7 @@ class Auth_Yadis_PlainHTTPFetcher extends Auth_Yadis_HTTPFetcher {
$host = 'ssl://' . $host;
}
- $user_agent = "PHP Yadis Library Fetcher";
+ $user_agent = Auth_OpenID_USER_AGENT;
$headers = array(
"GET ".$parts['path'].