- don't trap into any other transfer encoding than chunked
[m6w6/ext-http] / tests / parse_message_002.phpt
diff --git a/tests/parse_message_002.phpt b/tests/parse_message_002.phpt
new file mode 100644 (file)
index 0000000..d82aac9
--- /dev/null
@@ -0,0 +1,39 @@
+--TEST--
+identity encoding trap
+--SKIPIF--
+<?php
+include 'skip.inc';
+?>
+--FILE--
+<?php
+echo "-TEST\n";
+
+$message =
+"HTTP/1.1 200 Ok\n".
+"Transfer-Encoding: identity\n".
+"Content-Length: 3\n".
+"Content-Type: text/plain\n\n".
+"Hi!foo";
+
+print_r(http_parse_message($message));
+
+echo "Done\n";
+--EXPECTF--
+%sTEST
+stdClass Object
+(
+    [type] => 2
+    [httpVersion] => 1.1
+    [responseCode] => 200
+    [responseStatus] => Ok
+    [headers] => Array
+        (
+            [Transfer-Encoding] => identity
+            [Content-Length] => 3
+            [Content-Type] => text/plain
+        )
+
+    [body] => Hi!
+    [parentMessage] => 
+)
+Done