diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-28 08:00:51 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-28 08:00:51 (GMT) |
| commit | e5766f95f8b74aa6577cf8dff98d48a71ab9d131 (patch) | |
| tree | 6e85f7dd2b98f0c060086540c153617c8b70ae9d /library | |
| parent | 69d1bdb95ef90f112d06b7ece0d6db57c504a030 (diff) | |
| parent | 2836feb5d8fbaffcd6371c423cd0a0b0eebac840 (diff) | |
| download | tcl-fix_1997007.zip tcl-fix_1997007.tar.gz tcl-fix_1997007.tar.bz2 | |
merge core-8-6-branchfix_1997007
Diffstat (limited to 'library')
| -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 {} { |
