diff options
author | max <max@tclers.tk> | 2013-04-04 14:42:19 (GMT) |
---|---|---|
committer | max <max@tclers.tk> | 2013-04-04 14:42:19 (GMT) |
commit | 91b943a9a0a7d05e20c4b4dd02af0f86e7db48b7 (patch) | |
tree | 45959397b29bce6bd1bc6b815c0afa387f519613 /tests | |
parent | c70e635d90321aba50e235fa636bcf1f78dfeda5 (diff) | |
download | tcl-91b943a9a0a7d05e20c4b4dd02af0f86e7db48b7.zip tcl-91b943a9a0a7d05e20c4b4dd02af0f86e7db48b7.tar.gz tcl-91b943a9a0a7d05e20c4b4dd02af0f86e7db48b7.tar.bz2 |
Allow URLs that don't have a path, but a query query, e.g. http://example.com?foo=bar .
Diffstat (limited to 'tests')
-rw-r--r-- | tests/http.test | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/http.test b/tests/http.test index e2de7d8..7d439b1 100644 --- a/tests/http.test +++ b/tests/http.test @@ -135,6 +135,7 @@ set fullurl http://user:pass@[info hostname]:$port/a/b/c set binurl //[info hostname]:$port/binary set posturl //[info hostname]:$port/post set badposturl //[info hostname]:$port/droppost +set authorityurl //[info hostname]:$port set ipv6url http://\[::1\]:$port/ test http-3.4 {http::geturl} -body { set token [http::geturl $url] @@ -391,7 +392,7 @@ Connection close Content-Type {text/plain;charset=utf-8} Accept-Encoding .* Content-Length 5} -test http-3.29 "http::geturl $ipv6url" -body { +test http-3.29 {http::geturl IPv6 address} -body { # We only want to see if the URL gets parsed correctly. This is # the case if http::geturl succeeds or returns a socket related # error. If the parsing is wrong, we'll get a parse error. @@ -405,7 +406,18 @@ test http-3.29 "http::geturl $ipv6url" -body { } -cleanup { catch { http::cleanup $token } } -result 0 - +test http-3.30 {http::geturl query without path} -body { + set token [http::geturl $authorityurl?var=val] + http::ncode $token +} -cleanup { + catch { http::cleanup $token } +} -result 200 +test http-3.31 {http::geturl fragment without path} -body { + set token [http::geturl "$authorityurl#fragment42"] + http::ncode $token +} -cleanup { + catch { http::cleanup $token } +} -result 200 test http-4.1 {http::Event} -body { set token [http::geturl $url -keepalive 0] upvar #0 $token data |