summaryrefslogtreecommitdiffstats
path: root/tests/httpd11.tcl
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2015-05-17 19:49:44 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2015-05-17 19:49:44 (GMT)
commit2c15b241eada4c3508f40bc48287bfc3617bbd76 (patch)
tree2905f9e58003ed85727b6c497ff9b87b5b09d37b /tests/httpd11.tcl
parent797f5c18a178ccf6347e2f64c565216353e9e255 (diff)
parent25217a3ed35a8e8d7a9b5fd1c79a84ffbca0164b (diff)
downloadtcl-2c15b241eada4c3508f40bc48287bfc3617bbd76.zip
tcl-2c15b241eada4c3508f40bc48287bfc3617bbd76.tar.gz
tcl-2c15b241eada4c3508f40bc48287bfc3617bbd76.tar.bz2
Merge updates from trunk.
Diffstat (limited to 'tests/httpd11.tcl')
-rw-r--r--tests/httpd11.tcl15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/httpd11.tcl b/tests/httpd11.tcl
index 9c543dc..267f409 100644
--- a/tests/httpd11.tcl
+++ b/tests/httpd11.tcl
@@ -158,13 +158,13 @@ proc Service {chan addr port} {
}
if {$protocol eq "HTTP/1.1"} {
- if {[string match "*deflate*" [dict get? $meta accept-encoding]]} {
- set encoding deflate
- } elseif {[string match "*gzip*" [dict get? $meta accept-encoding]]} {
- set encoding gzip
- } elseif {[string match "*compress*" [dict get? $meta accept-encoding]]} {
- set encoding compress
- }
+ foreach enc [split [dict get? $meta accept-encoding] ,] {
+ set enc [string trim $enc]
+ if {$enc in {deflate gzip compress}} {
+ set encoding $enc
+ break
+ }
+ }
set transfer chunked
} else {
set close 1
@@ -189,6 +189,7 @@ proc Service {chan addr port} {
if {$close} {
Puts $chan "connection: close"
}
+ Puts $chan "x-requested-encodings: [dict get? $meta accept-encoding]"
if {$encoding eq "identity"} {
Puts $chan "content-length: [string length $data]"
} else {