diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-20 06:15:55 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-20 06:15:55 (GMT) |
| commit | 3d3574a29acb65e49229c127cff1e875d7977c91 (patch) | |
| tree | 5a7f5ba1d04a2a3b12b0d8dd0b9f2468cd7eafe0 /library/http | |
| parent | 3d42a8913e2e9598c4a6aeba195d14261826b7c7 (diff) | |
| parent | d48b6bfcd6c717eca2710e41f09129ab78b2a20f (diff) | |
| download | tcl-tip_312.zip tcl-tip_312.tar.gz tcl-tip_312.tar.bz2 | |
merge trunktip_312
Diffstat (limited to 'library/http')
| -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 {} { |
