summaryrefslogtreecommitdiffstats
path: root/Auth
diff options
context:
space:
mode:
authortailor <dag@janrain.com>2008-05-30 22:48:59 +0000
committertailor <dag@janrain.com>2008-05-30 22:48:59 +0000
commit0f02cd32ac681d5a921084d7653e7ea2f62e2f2f (patch)
tree547e9f5b36da684b402389d44d64595fe2926890 /Auth
parent284e75f2625e2bc923a68ba0b750d192fdafba32 (diff)
downloadphp-openid-0f02cd32ac681d5a921084d7653e7ea2f62e2f2f.zip
php-openid-0f02cd32ac681d5a921084d7653e7ea2f62e2f2f.tar.gz
php-openid-0f02cd32ac681d5a921084d7653e7ea2f62e2f2f.tar.bz2
[project @ Set User-Agent string in fetchers. include various versions]
Diffstat (limited to 'Auth')
-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'].