diff options
author | oehhar <harald.oehlmann@elmicron.de> | 2015-05-31 16:20:06 (GMT) |
---|---|---|
committer | oehhar <harald.oehlmann@elmicron.de> | 2015-05-31 16:20:06 (GMT) |
commit | f50357637950d7ee913d02d98cfa78ca49bd0e09 (patch) | |
tree | d53d085f4f5d210127092023f92633ef57a090f6 /tests/httpd11.tcl | |
parent | f9c9b71cd327714fabe221f91e2f9af29fdd9b85 (diff) | |
parent | 32461a99d3dc5741caf2f1c282ca57fe06220b79 (diff) | |
download | tcl-f50357637950d7ee913d02d98cfa78ca49bd0e09.zip tcl-f50357637950d7ee913d02d98cfa78ca49bd0e09.tar.gz tcl-f50357637950d7ee913d02d98cfa78ca49bd0e09.tar.bz2 |
merge 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 { |