summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/http.test7
-rw-r--r--tests/httpd4
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/http.test b/tests/http.test
index 2fc0a51..322fb36 100644
--- a/tests/http.test
+++ b/tests/http.test
@@ -132,6 +132,7 @@ set tail /a/b/c
set url //[info hostname]:$port/a/b/c
set fullurl HTTP://user:pass@[info hostname]:$port/a/b/c
set binurl //[info hostname]:$port/binary
+set xmlurl //[info hostname]:$port/xml
set posturl //[info hostname]:$port/post
set badposturl //[info hostname]:$port/droppost
set authorityurl //[info hostname]:$port
@@ -364,6 +365,12 @@ test http-3.31 {http::geturl fragment without path} -body {
} -cleanup {
catch { http::cleanup $token }
} -result 200
+test http-3.32 {http::geturl application/xml is text} -body {
+ set token [http::geturl "$xmlurl"]
+ scan [http::data $token] "<%\[^>]>%c<%\[^>]>"
+} -cleanup {
+ catch { http::cleanup $token }
+} -result {test 4660 /test}
test http-4.1 {http::Event} {
set token [http::geturl $url -keepalive 0]
diff --git a/tests/httpd b/tests/httpd
index 232e80a..8753912 100644
--- a/tests/httpd
+++ b/tests/httpd
@@ -171,6 +171,10 @@ proc httpdRespond { sock } {
set html "$bindata[info hostname]:$port$data(url)"
set type application/octet-stream
}
+ *xml* {
+ set html [encoding convertto utf-8 "<test>\u1234</test>"]
+ set type "application/xml;charset=UTF-8"
+ }
*post* {
set html "Got [string length $data(query)] bytes"
set type text/plain