Mercurial > hg > egg-tcls
diff urllog.tcl @ 269:d62280f2a9c7
urllog: Make user agent string configurable.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 23 Jan 2015 10:50:21 +0200 |
parents | da239a953e24 |
children | 5067843cee3d |
line wrap: on
line diff
--- a/urllog.tcl Fri Jan 23 10:25:51 2015 +0200 +++ b/urllog.tcl Fri Jan 23 10:50:21 2015 +0200 @@ -64,7 +64,12 @@ putlog "$urllog_message" ### HTTP module initialization -::http::config -useragent "$urllog_name/$urllog_version" +if {[info exists http_user_agent] && $http_user_agent != ""} { + ::http::config -useragent $http_user_agent +} else { + ::http::config -useragent "$urllog_name/$urllog_version" +} + if {[info exists http_use_proxy] && $http_use_proxy != 0} { ::http::config -proxyhost $http_proxy_host -proxyport $http_proxy_port putlog " (Using proxy $http_proxy_host:$http_proxy_port)"