Commits

gustafn committed d2d1c8c

Added test case for format used in Mac OS X WebDav client in PUT operations with chunked encoding

Comments (0)

Files changed (1)

tests/http_chunked.test

+# -*- Tcl -*-
 #
 # The contents of this file are subject to the Mozilla Public License
 # Version 1.1 (the "License"); you may not use this file except in
 } -result {200 {} 5 01234}
 
 
+test http_chunked-3-1 {
+
+    PUT with Transfer-Encoding Chunked and unknown Content-Length (but
+    provided X-Expected-Entity-Length). This is the format that WebDAV
+    client of Mac OS X uses (via Finder).
+
+} -constraints serverListen -setup {
+    ns_register_proc PUT /tclchunked {
+	set content [ns_conn content]
+	#ns_log notice "PUT received <$content>"
+	ns_return 200 text/plain $content
+    }
+} -body {
+    nstest_http -http 1.1 \
+	-omitcontentlength 1 \
+	-setheaders {Transfer-Encoding Chunked X-Expected-Entity-Length 13} \
+	-getheaders {Transfer-Encoding Content-Length} -getbody 1 \
+        PUT /tclchunked "0A\r\n1234567890\r\n03\r\nabc"
+} -cleanup {
+    ns_unregister_proc PUT /tclchunked
+} -result {200 {} 13 1234567890abc}
+
 
 cleanupTests