diff options
author | Joe Mistachkin <joe@mistachkin.com> | 2015-05-17 19:49:44 (GMT) |
---|---|---|
committer | Joe Mistachkin <joe@mistachkin.com> | 2015-05-17 19:49:44 (GMT) |
commit | 2c15b241eada4c3508f40bc48287bfc3617bbd76 (patch) | |
tree | 2905f9e58003ed85727b6c497ff9b87b5b09d37b /tests/httpd11.tcl | |
parent | 797f5c18a178ccf6347e2f64c565216353e9e255 (diff) | |
parent | 25217a3ed35a8e8d7a9b5fd1c79a84ffbca0164b (diff) | |
download | tcl-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.tcl | 15 |
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 { |