diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-18 19:02:51 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-18 19:02:51 (GMT) |
commit | d48b6bfcd6c717eca2710e41f09129ab78b2a20f (patch) | |
tree | b0539bc00c709bae8d3d06927a67a4ffe42038cd | |
parent | 9a1eaac6924a3dd04d0d2be0aaf724e0426077d1 (diff) | |
parent | 681a97f23f6dac0cf64084ca04dfa2e9cd422114 (diff) | |
download | tcl-d48b6bfcd6c717eca2710e41f09129ab78b2a20f.zip tcl-d48b6bfcd6c717eca2710e41f09129ab78b2a20f.tar.gz tcl-d48b6bfcd6c717eca2710e41f09129ab78b2a20f.tar.bz2 |
merge core-8-6-branch
-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 {} { |