# HG changeset patch # User Matti Hamalainen # Date 1422003021 -7200 # Node ID d62280f2a9c7081c7281f18a48d459b4fb6e0397 # Parent 96310b1c88fa6c55c7616e084eb816f169ce7112 urllog: Make user agent string configurable. diff -r 96310b1c88fa -r d62280f2a9c7 config.urllog.example --- a/config.urllog.example Fri Jan 23 10:25:51 2015 +0200 +++ b/config.urllog.example Fri Jan 23 10:50:21 2015 +0200 @@ -21,6 +21,10 @@ set http_tls_cadir "/usr/share/ca-certificates/mozilla" +# Set 'user agent' string for HTTP. If empty or not set, default will be used. +set http_user_agent "" + + ### ### General options diff -r 96310b1c88fa -r d62280f2a9c7 urllog.tcl --- 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)"