diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-20 12:15:36 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-20 12:15:36 (GMT) |
commit | 3bcc6c4b763dc46cda817b8d4b40b8429a0195f4 (patch) | |
tree | 7ffa6fbf00ff168a0c82e1c956d34b3f2346fb40 /library/http/http.tcl | |
parent | 5a7bc1c76b9b56e6294cb6d11f537b54af3f85d3 (diff) | |
parent | 4df14cf19400ebdaa94bfe07bc4f84cb6116ae94 (diff) | |
download | tcl-3bcc6c4b763dc46cda817b8d4b40b8429a0195f4.zip tcl-3bcc6c4b763dc46cda817b8d4b40b8429a0195f4.tar.gz tcl-3bcc6c4b763dc46cda817b8d4b40b8429a0195f4.tar.bz2 |
merge trunk
Diffstat (limited to 'library/http/http.tcl')
-rw-r--r-- | library/http/http.tcl | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/library/http/http.tcl b/library/http/http.tcl index ccd4cd1..03751a3 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -28,10 +28,19 @@ namespace eval http { # We need a useragent string of this style or various servers will refuse to # send us compressed content even when we ask for it. This follows the # de-facto layout of user-agent strings in current browsers. - set http(-useragent) "Mozilla/5.0\ - ([string totitle $::tcl_platform(platform)]; U;\ - $::tcl_platform(os) $::tcl_platform(osVersion))\ - http/[package provide http] Tcl/[package provide Tcl]" + # Safe interpreters do not have ::tcl_platform(os) or + # ::tcl_platform(osVersion). + if {[interp issafe]} { + set http(-useragent) "Mozilla/5.0\ + (Windows; U;\ + Windows NT 10.0)\ + http/[package provide http] Tcl/[package provide Tcl]" + } else { + set http(-useragent) "Mozilla/5.0\ + ([string totitle $::tcl_platform(platform)]; U;\ + $::tcl_platform(os) $::tcl_platform(osVersion))\ + http/[package provide http] Tcl/[package provide Tcl]" + } } proc init {} { |