summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-04-19 15:22:22 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-04-19 15:22:22 (GMT)
commit6133b6a8f367811422d9803a856fb5f3434ecce9 (patch)
tree5eacc06f21ebabe6f52778eb10ff19d91e67b58e
parentf7d320c03b32f0300e5430135fa74fcc4d979279 (diff)
parent681a97f23f6dac0cf64084ca04dfa2e9cd422114 (diff)
downloadtcl-6133b6a8f367811422d9803a856fb5f3434ecce9.zip
tcl-6133b6a8f367811422d9803a856fb5f3434ecce9.tar.gz
tcl-6133b6a8f367811422d9803a856fb5f3434ecce9.tar.bz2
merge 8.6
-rw-r--r--changes2
-rw-r--r--library/http/http.tcl17
2 files changed, 15 insertions, 4 deletions
diff --git a/changes b/changes
index 74ab4ee..33b1bb7 100644
--- a/changes
+++ b/changes
@@ -8761,4 +8761,6 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
2017-04-12 (bug)[42202b] Nesting imbalance in coro injection (nadkarni,sebres)
+2017-04-18 (bug)[bc4322] http package support for safe interps (nash,nijtmans)
+
--- Released 8.6.7, April 30, 2016 --- http://core.tcl.tk/tcl/ for details
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 {} {