summaryrefslogtreecommitdiffstats
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/files/00-adhoc.t14
-rw-r--r--test/files/01-get.t14
-rw-r--r--test/files/02-header-test-apache2.tbin0 -> 394 bytes
-rw-r--r--test/files/03-post-urlencoded.t34
-rw-r--r--test/files/04-post-urlencoded-chunked.t26
-rw-r--r--test/files/05-expect.t39
-rw-r--r--test/files/06-uri-normal.t9
-rw-r--r--test/files/07-pipelined-connection.t15
-rw-r--r--test/files/08-not-pipelined-connection.t18
-rw-r--r--test/files/09-multi-packet-request-head.t14
-rw-r--r--test/files/10-host-in-headers.t34
-rw-r--r--test/files/100-auth-bearer.t5
-rw-r--r--test/files/100-response-body-data.t6
-rw-r--r--test/files/11-response-stream-closure.t13
-rw-r--r--test/files/12-connect-request.t21
-rw-r--r--test/files/13-compressed-response-gzip-ct.tbin0 -> 1462 bytes
-rw-r--r--test/files/14-compressed-response-gzip-chunked.tbin0 -> 29051 bytes
-rw-r--r--test/files/15-connect-complete.tbin0 -> 8601 bytes
-rw-r--r--test/files/16-connect-extra.t32
-rw-r--r--test/files/17-multipart-1.t41
-rw-r--r--test/files/18-compressed-response-deflate.tbin0 -> 1721 bytes
-rw-r--r--test/files/19-urlencoded-test.t15
-rw-r--r--test/files/20-ambiguous-host.t58
-rw-r--r--test/files/21-http09.t11
-rw-r--r--test/files/22-http_1_1-host_missing14
-rw-r--r--test/files/22-php-param-processing.t14
-rw-r--r--test/files/23-http09-multiple.t12
-rw-r--r--test/files/24-http09-explicit.t13
-rw-r--r--test/files/25-small-chunks.t41
-rw-r--r--test/files/26-request-headers-raw.t41
-rw-r--r--test/files/27-request-trailer-raw.t26
-rw-r--r--test/files/28-response-headers-raw.t33
-rw-r--r--test/files/29-response-trailer-raw.t33
-rw-r--r--test/files/30-get-ipv6.t15
-rw-r--r--test/files/31-get-request-line-nul.tbin0 -> 209 bytes
-rw-r--r--test/files/32-invalid-hostname.t15
-rw-r--r--test/files/33-invalid-hostname.t15
-rw-r--r--test/files/34-invalid-hostname.t15
-rw-r--r--test/files/35-early-response.t18
-rw-r--r--test/files/36-invalid-request-1-invalid-c-l.t17
-rw-r--r--test/files/37-invalid-request-2-t-e-and-c-l.t28
-rw-r--r--test/files/38-invalid-request-3-invalid-t-e.t27
-rw-r--r--test/files/39-auto-destroy-crash.t34
-rw-r--r--test/files/40-auth-basic.t5
-rw-r--r--test/files/41-auth-digest.t8
-rw-r--r--test/files/42-unknown-method_only.t3
-rw-r--r--test/files/43-invalid-protocol.t3
-rw-r--r--test/files/44-auth-basic-invalid.t5
-rw-r--r--test/files/45-auth-digest-unquoted-username.t8
-rw-r--r--test/files/46-auth-digest-invalid-username.t8
-rw-r--r--test/files/47-auth-unrecognized.t5
-rw-r--r--test/files/48-invalid-response-headers-1.t17
-rw-r--r--test/files/49-invalid-response-headers-2.t15
-rw-r--r--test/files/50-util.t14
-rw-r--r--test/files/51-get-ipv6-invalid.t15
-rw-r--r--test/files/52-invalid-path.t15
-rw-r--r--test/files/53-path-utf8-none.t15
-rw-r--r--test/files/54-path-utf8-valid.t15
-rw-r--r--test/files/55-path-utf8-overlong-2.t15
-rw-r--r--test/files/56-path-utf8-overlong-3.t15
-rw-r--r--test/files/57-path-utf8-overlong-4.t15
-rw-r--r--test/files/58-path-utf8-invalid.t15
-rw-r--r--test/files/59-path-utf8-fullwidth.t15
-rw-r--r--test/files/60-request-cookies.t16
-rw-r--r--test/files/61-empty-line-between-requests.t19
-rw-r--r--test/files/62-post-no-body.t34
-rw-r--r--test/files/63-post-chunked-invalid-1.t26
-rw-r--r--test/files/64-post-chunked-invalid-2.t26
-rw-r--r--test/files/65-post-chunked-invalid-3.t26
-rw-r--r--test/files/66-post-chunked-split-chunk.t28
-rw-r--r--test/files/67-long-request-line.t16
-rw-r--r--test/files/68-invalid-request-header.tbin0 -> 267 bytes
-rw-r--r--test/files/69-long-response-header.t16
-rw-r--r--test/files/70-response-invalid-chunk-length.t18
-rw-r--r--test/files/71-response-split-chunk.t20
-rw-r--r--test/files/72-response-split-body.t16
-rw-r--r--test/files/73-response-te-and-cl.t19
-rw-r--r--test/files/74-response-multiple-cl.t14
-rw-r--r--test/files/75-response-invalid-cl.t13
-rw-r--r--test/files/76-response-no-body.t34
-rw-r--r--test/files/77-response-folded-headers.t35
-rw-r--r--test/files/78-response-no-status-headers.t8
-rw-r--r--test/files/79-connect-invalid-hostport.t32
-rw-r--r--test/files/80-hostname-invalid-1.t15
-rw-r--r--test/files/81-hostname-invalid-2.t15
-rw-r--r--test/files/82-put.t16
-rw-r--r--test/files/83-auth-digest-invalid-username-2.t5
-rw-r--r--test/files/84-response-no-status-headers-2.t7
-rw-r--r--test/files/85-zero-byte-request-timeout.t16
-rw-r--r--test/files/86-partial-request-timeout.t18
-rw-r--r--test/files/87-issue-55-incorrect-host-ambiguous-warning.t8
-rw-r--r--test/files/88-response-multiple-cl-mismatch.t14
-rw-r--r--test/files/89-get-whitespace.t14
-rw-r--r--test/files/90-request-uri-too-large.t17
-rw-r--r--test/files/91-request-unexpected-body.t16
-rw-r--r--test/files/92-http_0_9-method_only.t3
-rw-r--r--test/files/93-compressed-response-deflateasgzip.tbin0 -> 1718 bytes
-rw-r--r--test/files/94-compressed-response-multiple.tbin0 -> 311 bytes
-rw-r--r--test/files/95-compressed-response-gzipasdeflate.tbin0 -> 1465 bytes
-rw-r--r--test/files/96-compressed-response-lzma.tbin0 -> 336 bytes
-rw-r--r--test/files/97-requests-cut.t9
-rw-r--r--test/files/98-responses-cut.t26
-rw-r--r--test/files/99-expect-100.t27
-rw-r--r--test/files/anchor.empty0
-rwxr-xr-xtest/files/generate-gzip-tests.php322
-rw-r--r--test/files/gztest-01-minimal.gzbin0 -> 57 bytes
-rw-r--r--test/files/gztest-02-fname.gzbin0 -> 66 bytes
-rw-r--r--test/files/gztest-03-fcomment.gzbin0 -> 65 bytes
-rw-r--r--test/files/gztest-04-fhcrc.gzbin0 -> 59 bytes
-rw-r--r--test/files/gztest-05-fextra.gzbin0 -> 64 bytes
-rw-r--r--test/files/gztest-06-ftext.gzbin0 -> 57 bytes
-rw-r--r--test/files/gztest-07-freserved1.gzbin0 -> 57 bytes
-rw-r--r--test/files/gztest-08-freserved2.gzbin0 -> 57 bytes
-rw-r--r--test/files/gztest-09-freserved3.gzbin0 -> 57 bytes
-rw-r--r--test/files/gztest-10-multipart.gzbin0 -> 140 bytes
-rw-r--r--test/files/gztest-11-invalid-method.gzbin0 -> 57 bytes
-rw-r--r--test/files/gztest-12-invalid-crc32.gzbin0 -> 57 bytes
-rw-r--r--test/files/gztest-13-invalid-isize.gzbin0 -> 79 bytes
-rw-r--r--test/files/gztest-14-invalid-xfl.gzbin0 -> 57 bytes
-rw-r--r--test/files/gztest-15-invalid-fhcrc.gzbin0 -> 59 bytes
120 files changed, 2020 insertions, 0 deletions
diff --git a/test/files/00-adhoc.t b/test/files/00-adhoc.t
new file mode 100644
index 0000000..36805de
--- /dev/null
+++ b/test/files/00-adhoc.t
@@ -0,0 +1,14 @@
+>>>
+GET /?p=%20 HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/01-get.t b/test/files/01-get.t
new file mode 100644
index 0000000..e9edceb
--- /dev/null
+++ b/test/files/01-get.t
@@ -0,0 +1,14 @@
+>>>
+GET /?p=%20 HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/02-header-test-apache2.t b/test/files/02-header-test-apache2.t
new file mode 100644
index 0000000..a7cb787
--- /dev/null
+++ b/test/files/02-header-test-apache2.t
Binary files differ
diff --git a/test/files/03-post-urlencoded.t b/test/files/03-post-urlencoded.t
new file mode 100644
index 0000000..052377e
--- /dev/null
+++ b/test/files/03-post-urlencoded.t
@@ -0,0 +1,34 @@
+>>>
+POST /?qsp1=1&%20p%20q=2&u=Ivan+Risti%C4%87_Ivan+Risti%C4%87_Ivan+Risti%C4%87_Ivan+Risti%C4%87_Ivan+Risti%C4%87_Ivan+Risti%C4%87_ HTTP/1.0
+Content-Length: 12
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+
+p=0123456789
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World!
+>>>
+GET / HTTP/1.0
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Transfer-Encoding: chunked
+
+9
+012345678
+1
+9
+0
+
diff --git a/test/files/04-post-urlencoded-chunked.t b/test/files/04-post-urlencoded-chunked.t
new file mode 100644
index 0000000..1d72e71
--- /dev/null
+++ b/test/files/04-post-urlencoded-chunked.t
@@ -0,0 +1,26 @@
+>>>
+POST / HTTP/1.1
+Transfer-Encoding: chunked
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+Cookie: 1
+
+b
+p=012345678
+1
+9
+0
+Cookie:
+>>>
+ 2
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/05-expect.t b/test/files/05-expect.t
new file mode 100644
index 0000000..0ad3090
--- /dev/null
+++ b/test/files/05-expect.t
@@ -0,0 +1,39 @@
+>>>
+POST / HTTP/1.1
+User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8 libssh2/0.18
+Accept: */*
+Content-Length: 216
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------------------07869933ca1b
+
+
+<<<
+HTTP/1.1 100 Continue
+Header1: This
+Header2: That
+
+
+>>>
+------------------------------07869933ca1b
+Content-Disposition: form-data; name="file"; filename="404.php"
+Content-Type: application/octet-stream
+
+
+>>>
+<? echo "404"; ?>
+>>>
+
+------------------------------07869933ca1b--
+
+<<<
+HTTP/1.1 200 OK
+Date: Tue, 03 Nov 2009 09:27:47 GMT
+Server: Apache
+Last-Modified: Thu, 30 Apr 2009 12:20:49 GMT
+ETag: "2dcada-2d-468c4b9ec6a40"
+Accept-Ranges: bytes
+Content-Length: 45
+Vary: Accept-Encoding
+Content-Type: text/html
+
+<html><body><h1>It works!</h1></body></html>
diff --git a/test/files/06-uri-normal.t b/test/files/06-uri-normal.t
new file mode 100644
index 0000000..78a138c
--- /dev/null
+++ b/test/files/06-uri-normal.t
@@ -0,0 +1,9 @@
+>>>
+GET http://username:password@www.example.com:8080/sub/folder/file.jsp?p=q#f HTTP/1.0
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/07-pipelined-connection.t b/test/files/07-pipelined-connection.t
new file mode 100644
index 0000000..07ef603
--- /dev/null
+++ b/test/files/07-pipelined-connection.t
@@ -0,0 +1,15 @@
+>>>
+GET /first HTTP/1.1
+
+GET /second HTTP/1.1
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+
+Hello World!
+HTTP/1.0 200 OK
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/08-not-pipelined-connection.t b/test/files/08-not-pipelined-connection.t
new file mode 100644
index 0000000..2a1bac3
--- /dev/null
+++ b/test/files/08-not-pipelined-connection.t
@@ -0,0 +1,18 @@
+>>>
+GET /first HTTP/1.1
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+
+Hello World!
+>>>
+GET /second HTTP/1.1
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/09-multi-packet-request-head.t b/test/files/09-multi-packet-request-head.t
new file mode 100644
index 0000000..08a16f2
--- /dev/null
+++ b/test/files/09-multi-packet-request-head.t
@@ -0,0 +1,14 @@
+>>>
+GET / HTTP/1.0
+
+>>>
+Host: www.example.com
+
+>>>
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/10-host-in-headers.t b/test/files/10-host-in-headers.t
new file mode 100644
index 0000000..b892b0a
--- /dev/null
+++ b/test/files/10-host-in-headers.t
@@ -0,0 +1,34 @@
+>>>
+GET / HTTP/1.1
+Host: www.example.com
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+
+Hello World!
+>>>
+GET / HTTP/1.1
+Host: www.example.com.
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+>>>
+GET / HTTP/1.1
+Host: WwW.ExamPle.cOm
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+>>>
+GET / HTTP/1.1
+Host: www.example.com:80
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12 \ No newline at end of file
diff --git a/test/files/100-auth-bearer.t b/test/files/100-auth-bearer.t
new file mode 100644
index 0000000..4c1456a
--- /dev/null
+++ b/test/files/100-auth-bearer.t
@@ -0,0 +1,5 @@
+>>>
+GET / HTTP/1.1
+Host: www.example.com
+Authorization: Bearer mF_9.B5f-4.1JqM
+
diff --git a/test/files/100-response-body-data.t b/test/files/100-response-body-data.t
new file mode 100644
index 0000000..020bebd
--- /dev/null
+++ b/test/files/100-response-body-data.t
@@ -0,0 +1,6 @@
+<<<
+1
+2
+<<<
+3
+4 \ No newline at end of file
diff --git a/test/files/11-response-stream-closure.t b/test/files/11-response-stream-closure.t
new file mode 100644
index 0000000..8bc167c
--- /dev/null
+++ b/test/files/11-response-stream-closure.t
@@ -0,0 +1,13 @@
+>>>
+GET / HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+
+Hello World! \ No newline at end of file
diff --git a/test/files/12-connect-request.t b/test/files/12-connect-request.t
new file mode 100644
index 0000000..89faf8e
--- /dev/null
+++ b/test/files/12-connect-request.t
@@ -0,0 +1,21 @@
+>>>
+CONNECT www.ssllabs.com:443 HTTP/1.0
+
+
+<<<
+HTTP/1.1 405 Method Not Allowed
+Date: Sat, 12 Dec 2009 05:08:45 GMT
+Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8g PHP/5.3.0
+Allow: GET,HEAD,POST,OPTIONS,TRACE
+Vary: Accept-Encoding
+Content-Length: 230
+Connection: close
+Content-Type: text/html; charset=iso-8859-1
+
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<html><head>
+<title>405 Method Not Allowed</title>
+</head><body>
+<h1>Method Not Allowed</h1>
+<p>The requested method CONNECT is not allowed for the URL /.</p>
+</body></html> \ No newline at end of file
diff --git a/test/files/13-compressed-response-gzip-ct.t b/test/files/13-compressed-response-gzip-ct.t
new file mode 100644
index 0000000..d5a2e31
--- /dev/null
+++ b/test/files/13-compressed-response-gzip-ct.t
Binary files differ
diff --git a/test/files/14-compressed-response-gzip-chunked.t b/test/files/14-compressed-response-gzip-chunked.t
new file mode 100644
index 0000000..bae8a2d
--- /dev/null
+++ b/test/files/14-compressed-response-gzip-chunked.t
Binary files differ
diff --git a/test/files/15-connect-complete.t b/test/files/15-connect-complete.t
new file mode 100644
index 0000000..071d064
--- /dev/null
+++ b/test/files/15-connect-complete.t
Binary files differ
diff --git a/test/files/16-connect-extra.t b/test/files/16-connect-extra.t
new file mode 100644
index 0000000..9c08f17
--- /dev/null
+++ b/test/files/16-connect-extra.t
@@ -0,0 +1,32 @@
+>>>
+CONNECT www.feistyduck.com:80 HTTP/1.1
+Host: www.feistyduck.com
+
+HEAD / HTTP/1.0
+
+
+<<<
+HTTP/1.1 301 Moved Permanently
+Date: Wed, 06 Jan 2010 17:41:34 GMT
+Server: Apache
+Location: https://www.feistyduck.com/
+Vary: Accept-Encoding
+Content-Length: 235
+Content-Type: text/html; charset=iso-8859-1
+
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<html><head>
+<title>301 Moved Permanently</title>
+</head><body>
+<h1>Moved Permanently</h1>
+<p>The document has moved <a href="https://www.feistyduck.com/">here</a>.</p>
+</body></html>
+
+HTTP/1.1 301 Moved Permanently
+Date: Wed, 06 Jan 2010 17:41:46 GMT
+Server: Apache
+Location: https://www.feistyduck.com/
+Vary: Accept-Encoding
+Connection: close
+Content-Type: text/html; charset=iso-8859-1
+
diff --git a/test/files/17-multipart-1.t b/test/files/17-multipart-1.t
new file mode 100644
index 0000000..7c083c6
--- /dev/null
+++ b/test/files/17-multipart-1.t
@@ -0,0 +1,41 @@
+>>>
+POST /upload.php?qsp1=1&%20p%20q=2 HTTP/1.1
+Host: 192.168.3.100:8080
+User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)
+Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
+Accept-Language: en-us,en;q=0.5
+Accept-Encoding: gzip,deflate
+Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
+Keep-Alive: 300
+Connection: keep-alive
+Content-Type: multipart/form-data; boundary=---------------------------41184676334
+Content-Length: 610
+
+-----------------------------41184676334
+Content-Disposition: form-data; name="field1"
+
+0123456789
+-----------------------------41184676334
+Content-Disposition: form-data; name="field2"
+
+9876543210
+-----------------------------41184676334
+Content-Disposition: form-data; name="file1"; filename="New Text Document.txt"
+Content-Type: text/plain
+
+FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+-----------------------------41184676334
+Content-Disposition: form-data; name="file2"; filename="New Text Document.txt"
+Content-Type: text/plain
+
+FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+-----------------------------41184676334--
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+
+Hello World! \ No newline at end of file
diff --git a/test/files/18-compressed-response-deflate.t b/test/files/18-compressed-response-deflate.t
new file mode 100644
index 0000000..b70940e
--- /dev/null
+++ b/test/files/18-compressed-response-deflate.t
Binary files differ
diff --git a/test/files/19-urlencoded-test.t b/test/files/19-urlencoded-test.t
new file mode 100644
index 0000000..21d7f27
--- /dev/null
+++ b/test/files/19-urlencoded-test.t
@@ -0,0 +1,15 @@
+>>>
+POST /?p=1&q=2 HTTP/1.0
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 11
+
+p=3&q=4&z=5
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/20-ambiguous-host.t b/test/files/20-ambiguous-host.t
new file mode 100644
index 0000000..bb3e551
--- /dev/null
+++ b/test/files/20-ambiguous-host.t
@@ -0,0 +1,58 @@
+>>>
+GET http://example.com/1 HTTP/1.1
+Host: example.com
+
+
+<<<
+HTTP/1.1 200 OK
+Date: Mon, 26 Apr 2010 13:56:31 GMT
+Content-Length: 8
+
+12345678
+>>>
+GET http://example.com/2 HTTP/1.1
+Host: foo.com
+
+
+<<<
+HTTP/1.1 200 OK
+Date: Mon, 26 Apr 2010 13:56:31 GMT
+Content-Length: 8
+
+12345678
+>>>
+POST http://www.example.com:8001/3 HTTP/1.1
+Host: www.example.com:8001
+Content-Length: 8
+
+12345678
+<<<
+HTTP/1.1 200 OK
+Date: Mon, 26 Apr 2010 13:56:31 GMT
+Content-Length: 8
+
+12345678
+>>>
+POST http://www.example.com:8002/4 HTTP/1.1
+Host: www.example.com:8003
+Content-Length: 8
+
+12345678
+<<<
+HTTP/1.1 200 OK
+Date: Mon, 26 Apr 2010 13:56:31 GMT
+Content-Length: 8
+
+12345678
+>>>
+POST http://www.example.com:80/5 HTTP/1.1
+Host: www.example.com
+Content-Length: 8
+
+12345678
+<<<
+HTTP/1.1 200 OK
+Date: Mon, 26 Apr 2010 13:56:31 GMT
+Content-Length: 8
+
+12345678 \ No newline at end of file
diff --git a/test/files/21-http09.t b/test/files/21-http09.t
new file mode 100644
index 0000000..5359a7f
--- /dev/null
+++ b/test/files/21-http09.t
@@ -0,0 +1,11 @@
+>>>
+GET /?foo=bar
+
+<<<
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<html><head>
+<title>301 Moved Permanently</title>
+</head><body>
+<h1>Moved Permanently</h1>
+<p>The document has moved.</p>
+</body></html>
diff --git a/test/files/22-http_1_1-host_missing b/test/files/22-http_1_1-host_missing
new file mode 100644
index 0000000..53ca3e8
--- /dev/null
+++ b/test/files/22-http_1_1-host_missing
@@ -0,0 +1,14 @@
+>>>
+GET /?p=%20 HTTP/1.1
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/22-php-param-processing.t b/test/files/22-php-param-processing.t
new file mode 100644
index 0000000..772a6d1
--- /dev/null
+++ b/test/files/22-php-param-processing.t
@@ -0,0 +1,14 @@
+>>>
+GET /?%20p%20q%20=1&q=2&z%20w=3 HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/23-http09-multiple.t b/test/files/23-http09-multiple.t
new file mode 100644
index 0000000..5fcb04b
--- /dev/null
+++ b/test/files/23-http09-multiple.t
@@ -0,0 +1,12 @@
+>>>
+GET /?foo=bar
+GET /?foo=bar
+
+<<<
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<html><head>
+<title>301 Moved Permanently</title>
+</head><body>
+<h1>Moved Permanently</h1>
+<p>The document has moved.</p>
+</body></html>
diff --git a/test/files/24-http09-explicit.t b/test/files/24-http09-explicit.t
new file mode 100644
index 0000000..0198991
--- /dev/null
+++ b/test/files/24-http09-explicit.t
@@ -0,0 +1,13 @@
+>>>
+GET /?foo=bar HTTP/0.9
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/25-small-chunks.t b/test/files/25-small-chunks.t
new file mode 100644
index 0000000..fdbfc9e
--- /dev/null
+++ b/test/files/25-small-chunks.t
@@ -0,0 +1,41 @@
+>>>
+GET
+>>>
+ /?x=y
+>>>
+ HTTP/1.0
+User-Agent:
+>>>
+ Test
+>>>
+ User
+>>>
+ Agent
+Host: www.example.com
+
+
+<<<
+HTTP/1.0
+<<<
+ 200
+<<<
+ OK
+Date:
+<<<
+ Mon,
+<<<
+ 31
+<<<
+ Aug
+<<<
+ 2009
+<<<
+ 20:25:50
+<<<
+ GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/26-request-headers-raw.t b/test/files/26-request-headers-raw.t
new file mode 100644
index 0000000..fdbfc9e
--- /dev/null
+++ b/test/files/26-request-headers-raw.t
@@ -0,0 +1,41 @@
+>>>
+GET
+>>>
+ /?x=y
+>>>
+ HTTP/1.0
+User-Agent:
+>>>
+ Test
+>>>
+ User
+>>>
+ Agent
+Host: www.example.com
+
+
+<<<
+HTTP/1.0
+<<<
+ 200
+<<<
+ OK
+Date:
+<<<
+ Mon,
+<<<
+ 31
+<<<
+ Aug
+<<<
+ 2009
+<<<
+ 20:25:50
+<<<
+ GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/27-request-trailer-raw.t b/test/files/27-request-trailer-raw.t
new file mode 100644
index 0000000..1d72e71
--- /dev/null
+++ b/test/files/27-request-trailer-raw.t
@@ -0,0 +1,26 @@
+>>>
+POST / HTTP/1.1
+Transfer-Encoding: chunked
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+Cookie: 1
+
+b
+p=012345678
+1
+9
+0
+Cookie:
+>>>
+ 2
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/28-response-headers-raw.t b/test/files/28-response-headers-raw.t
new file mode 100644
index 0000000..db1e07f
--- /dev/null
+++ b/test/files/28-response-headers-raw.t
@@ -0,0 +1,33 @@
+>>>
+GET /?p=%20 HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date:
+<<<
+ Mon,
+<<<
+ 31 Aug 2009 20:25:50 GMT
+Server:
+<<<
+ Apache
+Connection: close
+Content-Type: text/html
+Transfer-Encoding: chunked
+
+b
+Hello World
+1
+!
+0
+Set-Cookie:
+<<<
+ name=
+<<<
+value
+Another-Header:
+<<<
+ Header-Value
+
diff --git a/test/files/29-response-trailer-raw.t b/test/files/29-response-trailer-raw.t
new file mode 100644
index 0000000..db1e07f
--- /dev/null
+++ b/test/files/29-response-trailer-raw.t
@@ -0,0 +1,33 @@
+>>>
+GET /?p=%20 HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date:
+<<<
+ Mon,
+<<<
+ 31 Aug 2009 20:25:50 GMT
+Server:
+<<<
+ Apache
+Connection: close
+Content-Type: text/html
+Transfer-Encoding: chunked
+
+b
+Hello World
+1
+!
+0
+Set-Cookie:
+<<<
+ name=
+<<<
+value
+Another-Header:
+<<<
+ Header-Value
+
diff --git a/test/files/30-get-ipv6.t b/test/files/30-get-ipv6.t
new file mode 100644
index 0000000..baf3920
--- /dev/null
+++ b/test/files/30-get-ipv6.t
@@ -0,0 +1,15 @@
+>>>
+GET http://[::1]:8080/?p=%20 HTTP/1.0
+Host: [::1]:8080
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/31-get-request-line-nul.t b/test/files/31-get-request-line-nul.t
new file mode 100644
index 0000000..3de2eb4
--- /dev/null
+++ b/test/files/31-get-request-line-nul.t
Binary files differ
diff --git a/test/files/32-invalid-hostname.t b/test/files/32-invalid-hostname.t
new file mode 100644
index 0000000..a034785
--- /dev/null
+++ b/test/files/32-invalid-hostname.t
@@ -0,0 +1,15 @@
+>>>
+GET http://www..example.com/?p=%20 HTTP/1.0
+Host: www example.com
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/33-invalid-hostname.t b/test/files/33-invalid-hostname.t
new file mode 100644
index 0000000..ad18d33
--- /dev/null
+++ b/test/files/33-invalid-hostname.t
@@ -0,0 +1,15 @@
+>>>
+GET http://www.example.com:XXX/?p=%20 HTTP/1.0
+Host: www.example.com
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/34-invalid-hostname.t b/test/files/34-invalid-hostname.t
new file mode 100644
index 0000000..e886ebf
--- /dev/null
+++ b/test/files/34-invalid-hostname.t
@@ -0,0 +1,15 @@
+>>>
+GET /?p=%20 HTTP/1.0
+Host: www.example.com:
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/35-early-response.t b/test/files/35-early-response.t
new file mode 100644
index 0000000..4b205db
--- /dev/null
+++ b/test/files/35-early-response.t
@@ -0,0 +1,18 @@
+>>>
+POST / HTTP/1.0
+Content-Length: 12
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 400 Bad Request
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 11
+
+Bad Request
+>>>
+p=0123456789 \ No newline at end of file
diff --git a/test/files/36-invalid-request-1-invalid-c-l.t b/test/files/36-invalid-request-1-invalid-c-l.t
new file mode 100644
index 0000000..42980f4
--- /dev/null
+++ b/test/files/36-invalid-request-1-invalid-c-l.t
@@ -0,0 +1,17 @@
+>>>
+POST / HTTP/1.0
+Host: www.example.com
+Content-Length: ABC
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+
+p=0123456789
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/37-invalid-request-2-t-e-and-c-l.t b/test/files/37-invalid-request-2-t-e-and-c-l.t
new file mode 100644
index 0000000..8edab9c
--- /dev/null
+++ b/test/files/37-invalid-request-2-t-e-and-c-l.t
@@ -0,0 +1,28 @@
+>>>
+POST / HTTP/1.1
+Transfer-Encoding: chunked
+Content-Length: 12
+Host: www.example.com
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+Cookie: 1
+
+b
+p=012345678
+1
+9
+0
+Cookie:
+>>>
+ 2
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/38-invalid-request-3-invalid-t-e.t b/test/files/38-invalid-request-3-invalid-t-e.t
new file mode 100644
index 0000000..ada8dd5
--- /dev/null
+++ b/test/files/38-invalid-request-3-invalid-t-e.t
@@ -0,0 +1,27 @@
+>>>
+POST / HTTP/1.1
+Transfer-Encoding: ABC
+Host: www.example.com
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+Cookie: 1
+
+b
+p=012345678
+1
+9
+0
+Cookie:
+>>>
+ 2
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/39-auto-destroy-crash.t b/test/files/39-auto-destroy-crash.t
new file mode 100644
index 0000000..b892b0a
--- /dev/null
+++ b/test/files/39-auto-destroy-crash.t
@@ -0,0 +1,34 @@
+>>>
+GET / HTTP/1.1
+Host: www.example.com
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+
+Hello World!
+>>>
+GET / HTTP/1.1
+Host: www.example.com.
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+>>>
+GET / HTTP/1.1
+Host: WwW.ExamPle.cOm
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+>>>
+GET / HTTP/1.1
+Host: www.example.com:80
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12 \ No newline at end of file
diff --git a/test/files/40-auth-basic.t b/test/files/40-auth-basic.t
new file mode 100644
index 0000000..8606001
--- /dev/null
+++ b/test/files/40-auth-basic.t
@@ -0,0 +1,5 @@
+>>>
+GET / HTTP/1.0
+Host: www.example.com
+Authorization: Basic aXZhbnI6c2VjcmV0
+
diff --git a/test/files/41-auth-digest.t b/test/files/41-auth-digest.t
new file mode 100644
index 0000000..53065b0
--- /dev/null
+++ b/test/files/41-auth-digest.t
@@ -0,0 +1,8 @@
+>>>
+GET / HTTP/1.1
+Host: www.example.com
+Authorization: Digest username="ivanr", realm="Book Review",
+ nonce="OgmPjb/jAwA=7c5a49c2ed9416dba1b04b5307d6d935f74a859d",
+ uri="/review/", algorithm=MD5, response="3c430d26043cc306e0282635929d57cb",
+ qop=auth, nc=00000004, cnonce="c3bcee9534c051a0"
+
diff --git a/test/files/42-unknown-method_only.t b/test/files/42-unknown-method_only.t
new file mode 100644
index 0000000..8c9a603
--- /dev/null
+++ b/test/files/42-unknown-method_only.t
@@ -0,0 +1,3 @@
+>>>
+HELLO
+
diff --git a/test/files/43-invalid-protocol.t b/test/files/43-invalid-protocol.t
new file mode 100644
index 0000000..0e4c0ad
--- /dev/null
+++ b/test/files/43-invalid-protocol.t
@@ -0,0 +1,3 @@
+>>>
+GET / JUNK/1.0
+
diff --git a/test/files/44-auth-basic-invalid.t b/test/files/44-auth-basic-invalid.t
new file mode 100644
index 0000000..ed44445
--- /dev/null
+++ b/test/files/44-auth-basic-invalid.t
@@ -0,0 +1,5 @@
+>>>
+GET / HTTP/1.0
+Host: www.example.com
+Authorization: Basic notBase64:EncodedStuff
+
diff --git a/test/files/45-auth-digest-unquoted-username.t b/test/files/45-auth-digest-unquoted-username.t
new file mode 100644
index 0000000..855e00e
--- /dev/null
+++ b/test/files/45-auth-digest-unquoted-username.t
@@ -0,0 +1,8 @@
+>>>
+GET / HTTP/1.1
+Host: www.example.com
+Authorization: Digest username=ivanr, realm="Book Review",
+ nonce="OgmPjb/jAwA=7c5a49c2ed9416dba1b04b5307d6d935f74a859d",
+ uri="/review/", algorithm=MD5, response="3c430d26043cc306e0282635929d57cb",
+ qop=auth, nc=00000004, cnonce="c3bcee9534c051a0"
+
diff --git a/test/files/46-auth-digest-invalid-username.t b/test/files/46-auth-digest-invalid-username.t
new file mode 100644
index 0000000..dbd1c43
--- /dev/null
+++ b/test/files/46-auth-digest-invalid-username.t
@@ -0,0 +1,8 @@
+>>>
+GET / HTTP/1.1
+Host: www.example.com
+Authorization: Digest username = ivanr, realm="Book Review",
+ nonce="OgmPjb/jAwA=7c5a49c2ed9416dba1b04b5307d6d935f74a859d",
+ uri="/review/", algorithm=MD5, response="3c430d26043cc306e0282635929d57cb",
+ qop=auth, nc=00000004, cnonce="c3bcee9534c051a0"
+
diff --git a/test/files/47-auth-unrecognized.t b/test/files/47-auth-unrecognized.t
new file mode 100644
index 0000000..5d51455
--- /dev/null
+++ b/test/files/47-auth-unrecognized.t
@@ -0,0 +1,5 @@
+>>>
+GET / HTTP/1.1
+Host: www.example.com
+Authorization: Turbo customAuthDataHere
+
diff --git a/test/files/48-invalid-response-headers-1.t b/test/files/48-invalid-response-headers-1.t
new file mode 100644
index 0000000..d10582a
--- /dev/null
+++ b/test/files/48-invalid-response-headers-1.t
@@ -0,0 +1,17 @@
+>>>
+GET /?p=%20 HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+No Colon
+Lws : After Header Name
+Header@Name: Not Token
+
+Hello World! \ No newline at end of file
diff --git a/test/files/49-invalid-response-headers-2.t b/test/files/49-invalid-response-headers-2.t
new file mode 100644
index 0000000..16970f9
--- /dev/null
+++ b/test/files/49-invalid-response-headers-2.t
@@ -0,0 +1,15 @@
+>>>
+GET /?p=%20 HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+: Empty Name
+
+Hello World! \ No newline at end of file
diff --git a/test/files/50-util.t b/test/files/50-util.t
new file mode 100644
index 0000000..e9edceb
--- /dev/null
+++ b/test/files/50-util.t
@@ -0,0 +1,14 @@
+>>>
+GET /?p=%20 HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/51-get-ipv6-invalid.t b/test/files/51-get-ipv6-invalid.t
new file mode 100644
index 0000000..bde929c
--- /dev/null
+++ b/test/files/51-get-ipv6-invalid.t
@@ -0,0 +1,15 @@
+>>>
+GET http://[::1:8080/?p=%20 HTTP/1.0
+Host: [::1]:8080
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/52-invalid-path.t b/test/files/52-invalid-path.t
new file mode 100644
index 0000000..97528e7
--- /dev/null
+++ b/test/files/52-invalid-path.t
@@ -0,0 +1,15 @@
+>>>
+GET invalid/path?p=%20 HTTP/1.0
+Host: [::1]:8080
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/53-path-utf8-none.t b/test/files/53-path-utf8-none.t
new file mode 100644
index 0000000..9234cd9
--- /dev/null
+++ b/test/files/53-path-utf8-none.t
@@ -0,0 +1,15 @@
+>>>
+GET /Ristic.txt HTTP/1.0
+Host: www.example.com
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/54-path-utf8-valid.t b/test/files/54-path-utf8-valid.t
new file mode 100644
index 0000000..518918e
--- /dev/null
+++ b/test/files/54-path-utf8-valid.t
@@ -0,0 +1,15 @@
+>>>
+GET /Risti%C4%87.txt HTTP/1.0
+Host: www.example.com
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/55-path-utf8-overlong-2.t b/test/files/55-path-utf8-overlong-2.t
new file mode 100644
index 0000000..f78a088
--- /dev/null
+++ b/test/files/55-path-utf8-overlong-2.t
@@ -0,0 +1,15 @@
+>>>
+GET /%c0%a6.txt HTTP/1.0
+Host: www.example.com
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/56-path-utf8-overlong-3.t b/test/files/56-path-utf8-overlong-3.t
new file mode 100644
index 0000000..3184dc8
--- /dev/null
+++ b/test/files/56-path-utf8-overlong-3.t
@@ -0,0 +1,15 @@
+>>>
+GET /%e0%80%a6.txt HTTP/1.0
+Host: www.example.com
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/57-path-utf8-overlong-4.t b/test/files/57-path-utf8-overlong-4.t
new file mode 100644
index 0000000..cfccdbe
--- /dev/null
+++ b/test/files/57-path-utf8-overlong-4.t
@@ -0,0 +1,15 @@
+>>>
+GET /%f0%80%80%a6.txt HTTP/1.0
+Host: www.example.com
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/58-path-utf8-invalid.t b/test/files/58-path-utf8-invalid.t
new file mode 100644
index 0000000..f3d5803
--- /dev/null
+++ b/test/files/58-path-utf8-invalid.t
@@ -0,0 +1,15 @@
+>>>
+GET /Risti%C4%87%80.txt HTTP/1.0
+Host: www.example.com
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/59-path-utf8-fullwidth.t b/test/files/59-path-utf8-fullwidth.t
new file mode 100644
index 0000000..4321652
--- /dev/null
+++ b/test/files/59-path-utf8-fullwidth.t
@@ -0,0 +1,15 @@
+>>>
+GET /%EF%BC%86.txt HTTP/1.0
+Host: www.example.com
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/60-request-cookies.t b/test/files/60-request-cookies.t
new file mode 100644
index 0000000..51aca6f
--- /dev/null
+++ b/test/files/60-request-cookies.t
@@ -0,0 +1,16 @@
+>>>
+GET / HTTP/1.0
+Host: www.example.com
+User-Agent: Mozilla
+Cookie: =0; p=1; q=2; =; z=
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/61-empty-line-between-requests.t b/test/files/61-empty-line-between-requests.t
new file mode 100644
index 0000000..47a8c21
--- /dev/null
+++ b/test/files/61-empty-line-between-requests.t
@@ -0,0 +1,19 @@
+>>>
+GET /first HTTP/1.1
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+
+Hello World!
+>>>
+
+GET /second HTTP/1.1
+
+
+<<<
+HTTP/1.0 200 OK
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/62-post-no-body.t b/test/files/62-post-no-body.t
new file mode 100644
index 0000000..10a8d4b
--- /dev/null
+++ b/test/files/62-post-no-body.t
@@ -0,0 +1,34 @@
+>>>
+POST / HTTP/1.0
+Content-Length: 0
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World!
+>>>
+GET / HTTP/1.0
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Transfer-Encoding: chunked
+
+9
+012345678
+1
+9
+0
+
diff --git a/test/files/63-post-chunked-invalid-1.t b/test/files/63-post-chunked-invalid-1.t
new file mode 100644
index 0000000..eb5ef0c
--- /dev/null
+++ b/test/files/63-post-chunked-invalid-1.t
@@ -0,0 +1,26 @@
+>>>
+POST / HTTP/1.1
+Transfer-Encoding: chunked
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+Cookie: 1
+
+80000000
+p=012345678
+1
+9
+0
+Cookie:
+>>>
+ 2
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/64-post-chunked-invalid-2.t b/test/files/64-post-chunked-invalid-2.t
new file mode 100644
index 0000000..f5fc91d
--- /dev/null
+++ b/test/files/64-post-chunked-invalid-2.t
@@ -0,0 +1,26 @@
+>>>
+POST / HTTP/1.1
+Transfer-Encoding: chunked
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+Cookie: 1
+
+-1
+p=012345678
+1
+9
+0
+Cookie:
+>>>
+ 2
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/65-post-chunked-invalid-3.t b/test/files/65-post-chunked-invalid-3.t
new file mode 100644
index 0000000..4076e0b
--- /dev/null
+++ b/test/files/65-post-chunked-invalid-3.t
@@ -0,0 +1,26 @@
+>>>
+POST / HTTP/1.1
+Transfer-Encoding: chunked
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+Cookie: 1
+
+
+p=012345678
+1
+9
+0
+Cookie:
+>>>
+ 2
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/66-post-chunked-split-chunk.t b/test/files/66-post-chunked-split-chunk.t
new file mode 100644
index 0000000..6f5dd48
--- /dev/null
+++ b/test/files/66-post-chunked-split-chunk.t
@@ -0,0 +1,28 @@
+>>>
+POST / HTTP/1.1
+Transfer-Encoding: chunked
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+Cookie: 1
+
+b
+p=01234
+>>>
+5678
+1
+9
+0
+Cookie:
+>>>
+ 2
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/67-long-request-line.t b/test/files/67-long-request-line.t
new file mode 100644
index 0000000..fa3f984
--- /dev/null
+++ b/test/files/67-long-request-line.t
@@ -0,0 +1,16 @@
+>>>
+GET /0123456789/
+>>>
+0123456789/ HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/68-invalid-request-header.t b/test/files/68-invalid-request-header.t
new file mode 100644
index 0000000..4e6d688
--- /dev/null
+++ b/test/files/68-invalid-request-header.t
Binary files differ
diff --git a/test/files/69-long-response-header.t b/test/files/69-long-response-header.t
new file mode 100644
index 0000000..822d3ca
--- /dev/null
+++ b/test/files/69-long-response-header.t
@@ -0,0 +1,16 @@
+>>>
+GET / HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache Apache Apache Apache
+<<<
+Apache Apache Apache Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/70-response-invalid-chunk-length.t b/test/files/70-response-invalid-chunk-length.t
new file mode 100644
index 0000000..68b43e3
--- /dev/null
+++ b/test/files/70-response-invalid-chunk-length.t
@@ -0,0 +1,18 @@
+>>>
+GET / HTTP/1.0
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Transfer-Encoding: chunked
+
+g
+012345678
+1
+9
+0
+
diff --git a/test/files/71-response-split-chunk.t b/test/files/71-response-split-chunk.t
new file mode 100644
index 0000000..1d3f091
--- /dev/null
+++ b/test/files/71-response-split-chunk.t
@@ -0,0 +1,20 @@
+>>>
+GET / HTTP/1.0
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Transfer-Encoding: chunked
+
+9
+01234
+<<<
+5678
+1
+9
+0
+
diff --git a/test/files/72-response-split-body.t b/test/files/72-response-split-body.t
new file mode 100644
index 0000000..db5ab9f
--- /dev/null
+++ b/test/files/72-response-split-body.t
@@ -0,0 +1,16 @@
+>>>
+GET /?p=%20 HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello
+<<<
+ World! \ No newline at end of file
diff --git a/test/files/73-response-te-and-cl.t b/test/files/73-response-te-and-cl.t
new file mode 100644
index 0000000..46c646d
--- /dev/null
+++ b/test/files/73-response-te-and-cl.t
@@ -0,0 +1,19 @@
+>>>
+GET / HTTP/1.0
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 10
+Transfer-Encoding: chunked
+
+9
+012345678
+1
+9
+0
+
diff --git a/test/files/74-response-multiple-cl.t b/test/files/74-response-multiple-cl.t
new file mode 100644
index 0000000..556fb8f
--- /dev/null
+++ b/test/files/74-response-multiple-cl.t
@@ -0,0 +1,14 @@
+>>>
+GET / HTTP/1.0
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/75-response-invalid-cl.t b/test/files/75-response-invalid-cl.t
new file mode 100644
index 0000000..8743d88
--- /dev/null
+++ b/test/files/75-response-invalid-cl.t
@@ -0,0 +1,13 @@
+>>>
+GET / HTTP/1.0
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: -1
+
+Hello World! \ No newline at end of file
diff --git a/test/files/76-response-no-body.t b/test/files/76-response-no-body.t
new file mode 100644
index 0000000..831571c
--- /dev/null
+++ b/test/files/76-response-no-body.t
@@ -0,0 +1,34 @@
+>>>
+POST /?qsp1=1&%20p%20q=2&u=Ivan+Risti%C4%87_Ivan+Risti%C4%87_Ivan+Risti%C4%87_Ivan+Risti%C4%87_Ivan+Risti%C4%87_Ivan+Risti%C4%87_ HTTP/1.0
+Content-Length: 12
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+
+p=0123456789
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 0
+
+
+>>>
+GET / HTTP/1.0
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Transfer-Encoding: chunked
+
+9
+012345678
+1
+9
+0
+
diff --git a/test/files/77-response-folded-headers.t b/test/files/77-response-folded-headers.t
new file mode 100644
index 0000000..dd33c07
--- /dev/null
+++ b/test/files/77-response-folded-headers.t
@@ -0,0 +1,35 @@
+>>>
+POST / HTTP/1.0
+Content-Length: 12
+Content-Type: application/x-www-form-urlencoded
+User-Agent: Mozilla
+
+p=0123456789
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+ Server
+Connection: close
+Content-Type: text/html
+Content-Length: 0
+
+
+>>>
+GET / HTTP/1.0
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apach2
+Connection: close
+Content-Type: text/html
+Transfer-Encoding: chunked
+
+9
+012345678
+1
+9
+0
+
diff --git a/test/files/78-response-no-status-headers.t b/test/files/78-response-no-status-headers.t
new file mode 100644
index 0000000..82e8d2a
--- /dev/null
+++ b/test/files/78-response-no-status-headers.t
@@ -0,0 +1,8 @@
+>>>
+GET / HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+Hello
+World! \ No newline at end of file
diff --git a/test/files/79-connect-invalid-hostport.t b/test/files/79-connect-invalid-hostport.t
new file mode 100644
index 0000000..9258b7b
--- /dev/null
+++ b/test/files/79-connect-invalid-hostport.t
@@ -0,0 +1,32 @@
+>>>
+CONNECT [:80 HTTP/1.1
+Host: www.feistyduck.com
+
+HEAD / HTTP/1.0
+
+
+<<<
+HTTP/1.1 301 Moved Permanently
+Date: Wed, 06 Jan 2010 17:41:34 GMT
+Server: Apache
+Location: https://www.feistyduck.com/
+Vary: Accept-Encoding
+Content-Length: 235
+Content-Type: text/html; charset=iso-8859-1
+
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<html><head>
+<title>301 Moved Permanently</title>
+</head><body>
+<h1>Moved Permanently</h1>
+<p>The document has moved <a href="https://www.feistyduck.com/">here</a>.</p>
+</body></html>
+
+HTTP/1.1 301 Moved Permanently
+Date: Wed, 06 Jan 2010 17:41:46 GMT
+Server: Apache
+Location: https://www.feistyduck.com/
+Vary: Accept-Encoding
+Connection: close
+Content-Type: text/html; charset=iso-8859-1
+
diff --git a/test/files/80-hostname-invalid-1.t b/test/files/80-hostname-invalid-1.t
new file mode 100644
index 0000000..f5e28c1
--- /dev/null
+++ b/test/files/80-hostname-invalid-1.t
@@ -0,0 +1,15 @@
+>>>
+GET http://www.example.com/?p=%20 HTTP/1.0
+Host: [:80
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/81-hostname-invalid-2.t b/test/files/81-hostname-invalid-2.t
new file mode 100644
index 0000000..d3065c9
--- /dev/null
+++ b/test/files/81-hostname-invalid-2.t
@@ -0,0 +1,15 @@
+>>>
+GET http://[:80/?p=%20 HTTP/1.0
+Host: www.example.com
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/82-put.t b/test/files/82-put.t
new file mode 100644
index 0000000..9931462
--- /dev/null
+++ b/test/files/82-put.t
@@ -0,0 +1,16 @@
+>>>
+PUT / HTTP/1.0
+Host: www.example.com
+User-Agent: Mozilla
+Content-Length: 12
+
+Hello World!
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/83-auth-digest-invalid-username-2.t b/test/files/83-auth-digest-invalid-username-2.t
new file mode 100644
index 0000000..2344a40
--- /dev/null
+++ b/test/files/83-auth-digest-invalid-username-2.t
@@ -0,0 +1,5 @@
+>>>
+GET / HTTP/1.1
+Host: www.example.com
+Authorization: Digest username="ivanr
+
diff --git a/test/files/84-response-no-status-headers-2.t b/test/files/84-response-no-status-headers-2.t
new file mode 100644
index 0000000..239e08a
--- /dev/null
+++ b/test/files/84-response-no-status-headers-2.t
@@ -0,0 +1,7 @@
+>>>
+GET / HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+Hello World! \ No newline at end of file
diff --git a/test/files/85-zero-byte-request-timeout.t b/test/files/85-zero-byte-request-timeout.t
new file mode 100644
index 0000000..0cc0e09
--- /dev/null
+++ b/test/files/85-zero-byte-request-timeout.t
@@ -0,0 +1,16 @@
+<<<
+HTTP/1.0 408 Request Time-out
+Server: AkamaiGHost
+Mime-Version: 1.0
+Date: Fri, 27 Sep 2013 16:37:37 GMT
+Content-Type: text/html
+Content-Length: 218
+Expires: Fri, 27 Sep 2013 16:37:37 GMT
+
+<HTML><HEAD>
+<TITLE>Request Timeout</TITLE>
+</HEAD><BODY>
+<H1>Request Timeout</H1>
+The server timed out while waiting for the browser's request.<P>
+Reference&#32;&#35;2&#46;9efcd4d9&#46;1380708056&#46;0
+</BODY></HTML>
diff --git a/test/files/86-partial-request-timeout.t b/test/files/86-partial-request-timeout.t
new file mode 100644
index 0000000..97dc4bb
--- /dev/null
+++ b/test/files/86-partial-request-timeout.t
@@ -0,0 +1,18 @@
+>>>
+GET
+<<<
+HTTP/1.0 408 Request Time-out
+Server: AkamaiGHost
+Mime-Version: 1.0
+Date: Fri, 27 Sep 2013 16:37:37 GMT
+Content-Type: text/html
+Content-Length: 218
+Expires: Fri, 27 Sep 2013 16:37:37 GMT
+
+<HTML><HEAD>
+<TITLE>Request Timeout</TITLE>
+</HEAD><BODY>
+<H1>Request Timeout</H1>
+The server timed out while waiting for the browser's request.<P>
+Reference&#32;&#35;2&#46;9efcd4d9&#46;1380708056&#46;0
+</BODY></HTML>
diff --git a/test/files/87-issue-55-incorrect-host-ambiguous-warning.t b/test/files/87-issue-55-incorrect-host-ambiguous-warning.t
new file mode 100644
index 0000000..463ce5d
--- /dev/null
+++ b/test/files/87-issue-55-incorrect-host-ambiguous-warning.t
@@ -0,0 +1,8 @@
+>>>
+CONNECT www.example.com:443 HTTP/1.1
+Host: www.example.com:443
+Accept: */*
+Content-Type: text/html
+Proxy-Connection: Keep-Alive
+Content-length: 0
+
diff --git a/test/files/88-response-multiple-cl-mismatch.t b/test/files/88-response-multiple-cl-mismatch.t
new file mode 100644
index 0000000..a1c17c8
--- /dev/null
+++ b/test/files/88-response-multiple-cl-mismatch.t
@@ -0,0 +1,14 @@
+>>>
+GET / HTTP/1.0
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+Content-Length: 11
+
+Hello World! \ No newline at end of file
diff --git a/test/files/89-get-whitespace.t b/test/files/89-get-whitespace.t
new file mode 100644
index 0000000..0bb5b2d
--- /dev/null
+++ b/test/files/89-get-whitespace.t
@@ -0,0 +1,14 @@
+>>>
+ GET /?p=%20 HTTP/1.0
+User-Agent: Mozilla
+
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 12
+
+Hello World! \ No newline at end of file
diff --git a/test/files/90-request-uri-too-large.t b/test/files/90-request-uri-too-large.t
new file mode 100644
index 0000000..eef176a
--- /dev/null
+++ b/test/files/90-request-uri-too-large.t
@@ -0,0 +1,17 @@
+>>>
+GET /blaaaaaaaaaaaaaaaaaaaaaaaaa
+<<<
+HTTP/1.0 414 Request-URI Too Large
+Server: MyBigFatServer
+Mime-Version: 1.0
+Date: Fri, 27 Sep 2013 16:37:37 GMT
+Content-Type: text/html
+Content-Length: 139
+Expires: Fri, 27 Sep 2013 16:37:37 GMT
+
+<HTML><HEAD>
+<TITLE>Request-URI Too Large</TITLE>
+</HEAD><BODY>
+<H1>Request-URI Too Large</H1>
+The Request-URI is Too Large
+</BODY></HTML>
diff --git a/test/files/91-request-unexpected-body.t b/test/files/91-request-unexpected-body.t
new file mode 100644
index 0000000..358da12
--- /dev/null
+++ b/test/files/91-request-unexpected-body.t
@@ -0,0 +1,16 @@
+>>>
+POST / HTTP/1.1
+Host: localhost
+Content-Type: application/x-www-form-urlencoded
+
+login=foo&password=bar
+
+<<<
+HTTP/1.1 200 OK
+Content-Length: 0
+
+
+>>>
+GET / HTTP/1.1
+Host: localhost
+
diff --git a/test/files/92-http_0_9-method_only.t b/test/files/92-http_0_9-method_only.t
new file mode 100644
index 0000000..5c7c9b2
--- /dev/null
+++ b/test/files/92-http_0_9-method_only.t
@@ -0,0 +1,3 @@
+>>>
+GET /
+
diff --git a/test/files/93-compressed-response-deflateasgzip.t b/test/files/93-compressed-response-deflateasgzip.t
new file mode 100644
index 0000000..e6c2eb5
--- /dev/null
+++ b/test/files/93-compressed-response-deflateasgzip.t
Binary files differ
diff --git a/test/files/94-compressed-response-multiple.t b/test/files/94-compressed-response-multiple.t
new file mode 100644
index 0000000..4d0fdf7
--- /dev/null
+++ b/test/files/94-compressed-response-multiple.t
Binary files differ
diff --git a/test/files/95-compressed-response-gzipasdeflate.t b/test/files/95-compressed-response-gzipasdeflate.t
new file mode 100644
index 0000000..8076f83
--- /dev/null
+++ b/test/files/95-compressed-response-gzipasdeflate.t
Binary files differ
diff --git a/test/files/96-compressed-response-lzma.t b/test/files/96-compressed-response-lzma.t
new file mode 100644
index 0000000..a5ea306
--- /dev/null
+++ b/test/files/96-compressed-response-lzma.t
Binary files differ
diff --git a/test/files/97-requests-cut.t b/test/files/97-requests-cut.t
new file mode 100644
index 0000000..2d2da6c
--- /dev/null
+++ b/test/files/97-requests-cut.t
@@ -0,0 +1,9 @@
+>>>
+GET /?p=%20 HTTP/1.1
+User-Agent: Mozilla
+
+G
+>>>
+ET /?p=%21 HTTP/1.1
+User-Agent: Mozilla
+
diff --git a/test/files/98-responses-cut.t b/test/files/98-responses-cut.t
new file mode 100644
index 0000000..5bd8164
--- /dev/null
+++ b/test/files/98-responses-cut.t
@@ -0,0 +1,26 @@
+>>>
+GET /?p=%20 HTTP/1.1
+User-Agent: Mozilla
+
+GET /?p=%21 HTTP/1.1
+User-Agent: Mozilla
+
+<<<
+HTTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 14
+
+Hello World!
+H
+<<<
+TTP/1.0 200 OK
+Date: Mon, 31 Aug 2009 20:25:50 GMT
+Server: Apache
+Connection: close
+Content-Type: text/html
+Content-Length: 13
+
+Hello People! \ No newline at end of file
diff --git a/test/files/99-expect-100.t b/test/files/99-expect-100.t
new file mode 100644
index 0000000..422f97f
--- /dev/null
+++ b/test/files/99-expect-100.t
@@ -0,0 +1,27 @@
+>>>
+PUT /forbidden HTTP/1.1
+Content-Length: 14
+Expect: 100-continue
+
+
+<<<
+HTTP/1.0 401 Forbidden
+Content-Length: 0
+
+
+>>>
+POST /ok HTTP/1.1
+Content-Length: 14
+Expect: 100-continue
+
+
+<<<
+HTTP/1.0 100 continue
+Content-Length: 0
+
+
+>>>
+Hello People!
+
+<<<
+HTTP/1.0 200 OK
diff --git a/test/files/anchor.empty b/test/files/anchor.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/files/anchor.empty
diff --git a/test/files/generate-gzip-tests.php b/test/files/generate-gzip-tests.php
new file mode 100755
index 0000000..021c436
--- /dev/null
+++ b/test/files/generate-gzip-tests.php
@@ -0,0 +1,322 @@
+#!/usr/bin/env php
+<?
+
+/*
+Copyright (c) 2009-2010 Open Information Security Foundation
+Copyright (c) 2010-2013 Qualys, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+- Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+- Neither the name of the Qualys, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+/*
+
+ZLIB Compressed Data Format Specification version 3.3
+http://www.ietf.org/rfc/rfc1950.txt
+
+DEFLATE Compressed Data Format Specification version 1.3
+http://www.ietf.org/rfc/rfc1951.txt
+
+GZIP file format specification version 4.3
+http://www.ietf.org/rfc/rfc1952.txt
+
+*/
+
+class GzipTest {
+
+ private $compressionMethod = 0x08;
+
+ private $forcedFlags = false;
+
+ private $filename = false;
+
+ private $comment = false;
+
+ private $extra = false;
+
+ private $textFlag = false;
+
+ private $useHeaderCrc = false;
+
+ private $headerCrc = false;
+
+ private $crc32 = false;
+
+ private $isize = false;
+
+ private $data = "The five boxing wizards jump quickly.";
+
+ private $xfl = 0;
+
+ public function setCompressionMethod($m) {
+ $this->compressionMethod = $m;
+ }
+
+ public function setCrc32($crc) {
+ $this->crc32 = $crc;
+ }
+
+ public function setInputSize($len) {
+ $this->isize = $len;
+ }
+
+ public function setXfl($xfl) {
+ $this->xfl = $xfl;
+ }
+
+ public function setFilename($filename) {
+ $this->filename = $filename;
+ }
+
+ public function setComment($comment) {
+ $this->comment = $comment;
+ }
+
+ public function setExtra($extra) {
+ $this->extra = $extra;
+ }
+
+ public function setTextFlag($b) {
+ $this->textFlag = $b;
+ }
+
+ public function useHeaderCrc($b) {
+ $this->useHeaderCrc = $b;
+ }
+
+ public function setHeaderCrc($crc) {
+ $this->headerCrc = $crc;
+ }
+
+ public function setFlags($f) {
+ $this->forcedFlags = $f;
+ }
+
+ public function getFlags() {
+ if ($this->forcedFlags !== false) {
+ return $this->forcedFlags;
+ }
+
+ $flags = 0;
+
+ // FTEXT
+ if ($this->textFlag) {
+ $flags = $flags | 0x01;
+ }
+
+ // FHCRC
+ if ($this->useHeaderCrc) {
+ $flags = $flags | 0x02;
+ }
+
+ // FEXTRA
+ if ($this->extra !== false) {
+ $flags = $flags | 0x04;
+ }
+
+ // FNAME
+ if ($this->filename !== false) {
+ $flags = $flags | 0x08;
+ }
+
+ // FCOMMENT
+ if ($this->comment !== false) {
+ $flags = $flags | 0x16;
+ }
+
+ return $flags;
+ }
+
+ public function setData($data) {
+ $this->data = $data;
+ }
+
+ public function writeTo($filename) {
+ $fp = fopen($filename, "w+");
+ $this->write($fp);
+ fclose($fp);
+ }
+
+ public function write($fp) {
+ $header = "";
+
+ // header (ID1 + ID2)
+ $header .= "\x1f\x8b";
+
+ // compression method (CM)
+ $header .= pack("C", $this->compressionMethod);
+
+ // flags (FLG)
+ $header .= pack("C", $this->getFlags());
+
+ // mtime (MTIME)
+ $header .= "\x9c\x54\xf4\x50";
+
+ // extra flags (XFL)
+ $header .= pack("C", $this->xfl);
+
+ // operating system (OS)
+ $header .= "\xff";
+
+ // FEXTRA
+ if ($this->extra !== false) {
+ $header .= pack("v", strlen($this->extra));
+ $header .= $this->extra;
+ }
+
+ // FNAME
+ if ($this->filename !== false) {
+ $header .= $this->filename;
+ $header .= "\x00";
+ }
+
+ // FCOMMENT
+ if ($this->comment !== false) {
+ $header .= $this->comment;
+ $header .= "\x00";
+ }
+
+ fwrite($fp, $header);
+
+ // FHCRC
+ if ($this->useHeaderCrc) {
+ if ($this->headerCrc !== false) {
+ // "The CRC16 consists of the two least significant bytes of the CRC32 [...]"
+ fwrite($fp, pack("v", crc32($header)));
+ } else {
+ fwrite($fp, pack("v", $this->headerCrc));
+ }
+ }
+
+ // compressed blocks
+ $compressedData = gzcompress($this->data);
+ // The gzcompress() function does not produce output that's fully compatible with gzip,
+ // so we need to strip out the extra data: remove 2 bytes from the beginning
+ // (CMF and FLG) and 4 bytes from the end (Adler CRC).
+ $compressedData = substr($compressedData, 2, strlen($compressedData) - 6);
+ fwrite($fp, $compressedData);
+
+ // CRC32
+ if ($this->crc32 === false) {
+ fwrite($fp, pack("V", crc32($this->data)));
+ } else {
+ fwrite($fp, pack("V", $this->crc32));
+ }
+
+ // uncompressed size (ISIZE)
+ if ($this->isize === false) {
+ fwrite($fp, pack("V", strlen($this->data)));
+ } else {
+ fwrite($fp, pack("V", $this->isize));
+ }
+ }
+}
+
+// 01: minimal file
+$gz = new GzipTest();
+$gz->writeTo("gztest-01-minimal.gz");
+
+// 02: with FNAME
+$gz = new GzipTest();
+$gz->setFilename("file.txt");
+$gz->writeTo("gztest-02-fname.gz");
+
+// 03: with FCOMMENT
+$gz = new GzipTest();
+$gz->setComment("COMMENT");
+$gz->writeTo("gztest-03-fcomment.gz");
+
+// 04: with FHCRC
+$gz = new GzipTest();
+$gz->useHeaderCrc(true);
+$gz->writeTo("gztest-04-fhcrc.gz");
+
+// 05: with FEXTRA
+$gz = new GzipTest();
+$gz->setExtra("EXTRA");
+$gz->writeTo("gztest-05-fextra.gz");
+
+// 06: with FTEXT
+$gz = new GzipTest();
+$gz->setTextFlag(true);
+$gz->writeTo("gztest-06-ftext.gz");
+
+// 07: with FRESERVED1
+$gz = new GzipTest();
+$gz->setFlags($gz->getFlags() | 0x20);
+$gz->writeTo("gztest-07-freserved1.gz");
+
+// 08: with FRESERVED2
+$gz = new GzipTest();
+$gz->setFlags($gz->getFlags() | 0x40);
+$gz->writeTo("gztest-08-freserved2.gz");
+
+// 09: with FRESERVED3
+$gz = new GzipTest();
+$gz->setFlags($gz->getFlags() | 0x80);
+$gz->writeTo("gztest-09-freserved3.gz");
+
+// 10: Two parts (compressed streams)
+$gz = new GzipTest();
+$fp = fopen("gztest-10-multipart.gz", "w+");
+$gz->setFilename("file1.txt");
+$gz->write($fp);
+$gz->setData("The quick brown fox jumps over the lazy dog.");
+$gz->setFilename("file2.txt");
+$gz->write($fp);
+fclose($fp);
+
+// 11: Invalid compression method
+$gz = new GzipTest();
+$gz->setCompressionMethod(0x07);
+$gz->writeTo("gztest-11-invalid-method.gz");
+
+// 12: Invalid CRC32
+$gz = new GzipTest();
+$gz->setCrc32(0xffffffff);
+$gz->writeTo("gztest-12-invalid-crc32.gz");
+
+// 13: Invalid ISIZE
+$gz = new GzipTest();
+$gz->setData("Grumpy Wizards make toxic brew for the Evil Queen and Jack.");
+$gz->setInputSize(0x10);
+$gz->writeTo("gztest-13-invalid-isize.gz");
+
+// 14: Invalid extra flags (XFL)
+$gz = new GzipTest();
+$gz->setXfl(0xff);
+$gz->writeTo("gztest-14-invalid-xfl.gz");
+
+// 15: Invalid header CRC (FHCRC)
+$gz = new GzipTest();
+$gz->useHeaderCrc(true);
+$gz->setHeaderCrc(0xffff);
+$gz->writeTo("gztest-15-invalid-fhcrc.gz");
+
+?>
diff --git a/test/files/gztest-01-minimal.gz b/test/files/gztest-01-minimal.gz
new file mode 100644
index 0000000..e82fcde
--- /dev/null
+++ b/test/files/gztest-01-minimal.gz
Binary files differ
diff --git a/test/files/gztest-02-fname.gz b/test/files/gztest-02-fname.gz
new file mode 100644
index 0000000..bb38b70
--- /dev/null
+++ b/test/files/gztest-02-fname.gz
Binary files differ
diff --git a/test/files/gztest-03-fcomment.gz b/test/files/gztest-03-fcomment.gz
new file mode 100644
index 0000000..fe55135
--- /dev/null
+++ b/test/files/gztest-03-fcomment.gz
Binary files differ
diff --git a/test/files/gztest-04-fhcrc.gz b/test/files/gztest-04-fhcrc.gz
new file mode 100644
index 0000000..cd0ce6b
--- /dev/null
+++ b/test/files/gztest-04-fhcrc.gz
Binary files differ
diff --git a/test/files/gztest-05-fextra.gz b/test/files/gztest-05-fextra.gz
new file mode 100644
index 0000000..72290b0
--- /dev/null
+++ b/test/files/gztest-05-fextra.gz
Binary files differ
diff --git a/test/files/gztest-06-ftext.gz b/test/files/gztest-06-ftext.gz
new file mode 100644
index 0000000..9d9aecc
--- /dev/null
+++ b/test/files/gztest-06-ftext.gz
Binary files differ
diff --git a/test/files/gztest-07-freserved1.gz b/test/files/gztest-07-freserved1.gz
new file mode 100644
index 0000000..bd365b5
--- /dev/null
+++ b/test/files/gztest-07-freserved1.gz
Binary files differ
diff --git a/test/files/gztest-08-freserved2.gz b/test/files/gztest-08-freserved2.gz
new file mode 100644
index 0000000..e240ec1
--- /dev/null
+++ b/test/files/gztest-08-freserved2.gz
Binary files differ
diff --git a/test/files/gztest-09-freserved3.gz b/test/files/gztest-09-freserved3.gz
new file mode 100644
index 0000000..4071cdc
--- /dev/null
+++ b/test/files/gztest-09-freserved3.gz
Binary files differ
diff --git a/test/files/gztest-10-multipart.gz b/test/files/gztest-10-multipart.gz
new file mode 100644
index 0000000..a2c0cd5
--- /dev/null
+++ b/test/files/gztest-10-multipart.gz
Binary files differ
diff --git a/test/files/gztest-11-invalid-method.gz b/test/files/gztest-11-invalid-method.gz
new file mode 100644
index 0000000..9c13768
--- /dev/null
+++ b/test/files/gztest-11-invalid-method.gz
Binary files differ
diff --git a/test/files/gztest-12-invalid-crc32.gz b/test/files/gztest-12-invalid-crc32.gz
new file mode 100644
index 0000000..1832ef8
--- /dev/null
+++ b/test/files/gztest-12-invalid-crc32.gz
Binary files differ
diff --git a/test/files/gztest-13-invalid-isize.gz b/test/files/gztest-13-invalid-isize.gz
new file mode 100644
index 0000000..55263bc
--- /dev/null
+++ b/test/files/gztest-13-invalid-isize.gz
Binary files differ
diff --git a/test/files/gztest-14-invalid-xfl.gz b/test/files/gztest-14-invalid-xfl.gz
new file mode 100644
index 0000000..a844957
--- /dev/null
+++ b/test/files/gztest-14-invalid-xfl.gz
Binary files differ
diff --git a/test/files/gztest-15-invalid-fhcrc.gz b/test/files/gztest-15-invalid-fhcrc.gz
new file mode 100644
index 0000000..b6fa5dd
--- /dev/null
+++ b/test/files/gztest-15-invalid-fhcrc.gz
Binary files differ