projects
/
m6w6
/
ext-http
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
5977bd2
)
Don't send user-agent if the user sets it to NULL or ''
author
Ilia Alshanetsky
<iliaa@php.net>
Sat, 7 Jan 2006 18:31:06 +0000
(18:31 +0000)
committer
Ilia Alshanetsky
<iliaa@php.net>
Sat, 7 Jan 2006 18:31:06 +0000
(18:31 +0000)
http_request_api.c
patch
|
blob
|
history
diff --git
a/http_request_api.c
b/http_request_api.c
index 082c5fc768bece975c572a8a28031a97954a244b..440eacd99957d08fa3efa22e14d2ebde753da719 100644
(file)
--- a/
http_request_api.c
+++ b/
http_request_api.c
@@
-477,8
+477,12
@@
PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti
}
/* useragent, default "PECL::HTTP/version (PHP/version)" */
}
/* useragent, default "PECL::HTTP/version (PHP/version)" */
- if ((zoption = http_request_option(request, options, "useragent", IS_STRING)) && Z_STRLEN_P(zoption)) {
- HTTP_CURL_OPT(USERAGENT, Z_STRVAL_P(zoption));
+ if ((zoption = http_request_option(request, options, "useragent", IS_STRING))) {
+ if (Z_STRLEN_P(zoption)) {
+ HTTP_CURL_OPT(USERAGENT, Z_STRVAL_P(zoption));
+ } else {
+ HTTP_CURL_OPT(USERAGENT, NULL);
+ }
}
/* additional headers, array('name' => 'value') */
}
/* additional headers, array('name' => 'value') */