| # $Id$ |
| |
| # test interp pools |
| |
| set testfilename1 "headers.ws3" |
| |
| ::tcltest::test header-1.1 {websh header test} { |
| apachetest::start {} { |
| ### fixme: this can't work, because state doesn't handle |
| ### multiple headers correctly anyway ... |
| #set page [ ::http::geturl "${urlbase}$testfilename1" ] |
| |
| # other approach (connect directly) |
| set s [socket $host $port] |
| puts $s "GET /$testfilename1 HTTP/1.0" |
| puts $s "" |
| flush $s |
| set page "" |
| set count 0 |
| while {![eof $s]} { |
| set line [gets $s] |
| if {![regexp "^(Server|Generator|Date|Content-Length): .*" $line]} { |
| append page $line\n |
| } |
| } |
| close $s |
| } |
| ### fixme: this can't work, because state doesn't handle |
| ### multiple headers correctly anyway ... |
| # upvar 0 $page state |
| #array set meta $state(meta) |
| #array get meta |
| set page |
| } {HTTP/1.1 200 OK |
| Foo: bar |
| Foo: bla |
| Foo: que |
| Header1: bar |
| Header2: Foo |
| Header2: Bar |
| Connection: close |
| Content-Type: text/html |
| |
| hi world |
| } |