summaryrefslogtreecommitdiff
path: root/deps/http_parser/test.c
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-11-09 13:49:03 -0800
committerRyan Dahl <ry@tinyclouds.org>2010-11-09 15:02:18 -0800
commit8285f1286444718a3f1a9ff44290d0dfeccb0266 (patch)
tree8cb56e383b41b0867f39664cd4bdc646bad51bfc /deps/http_parser/test.c
parentc6029c75a4636099fc35f2e0b904385dda58eb1f (diff)
downloadnode-new-8285f1286444718a3f1a9ff44290d0dfeccb0266.tar.gz
Upgrade http-parser
Diffstat (limited to 'deps/http_parser/test.c')
-rw-r--r--deps/http_parser/test.c67
1 files changed, 66 insertions, 1 deletions
diff --git a/deps/http_parser/test.c b/deps/http_parser/test.c
index af9f3bb431..c6f94fd983 100644
--- a/deps/http_parser/test.c
+++ b/deps/http_parser/test.c
@@ -31,7 +31,7 @@
#undef FALSE
#define FALSE 0
-#define MAX_HEADERS 10
+#define MAX_HEADERS 13
#define MAX_ELEMENT_SIZE 500
#define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -833,6 +833,71 @@ const struct message responses[] =
,.body= "<xml>hello</xml>"
}
+
+#define RES_FIELD_UNDERSCORE 10
+/* Should handle spaces in header fields */
+, {.name= "field underscore"
+ ,.type= HTTP_RESPONSE
+ ,.raw= "HTTP/1.1 200 OK\r\n"
+ "Date: Tue, 28 Sep 2010 01:14:13 GMT\r\n"
+ "Server: Apache\r\n"
+ "Cache-Control: no-cache, must-revalidate\r\n"
+ "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n"
+ "Set-Cookie: PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com\r\n"
+ "Vary: Accept-Encoding\r\n"
+ "_eep-Alive: timeout=45\r\n" /* semantic value ignored */
+ "_onnection: Keep-Alive\r\n" /* semantic value ignored */
+ "Transfer-Encoding: chunked\r\n"
+ "Content-Type: text/html\r\n"
+ "Connection: close\r\n"
+ "\r\n"
+ "0\r\n\r\n"
+ ,.should_keep_alive= FALSE
+ ,.message_complete_on_eof= FALSE
+ ,.http_major= 1
+ ,.http_minor= 1
+ ,.status_code= 200
+ ,.num_headers= 11
+ ,.headers=
+ { { "Date", "Tue, 28 Sep 2010 01:14:13 GMT" }
+ , { "Server", "Apache" }
+ , { "Cache-Control", "no-cache, must-revalidate" }
+ , { "Expires", "Mon, 26 Jul 1997 05:00:00 GMT" }
+ , { "Set-Cookie", "PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com" }
+ , { "Vary", "Accept-Encoding" }
+ , { "_eep-Alive", "timeout=45" }
+ , { "_onnection", "Keep-Alive" }
+ , { "Transfer-Encoding", "chunked" }
+ , { "Content-Type", "text/html" }
+ , { "Connection", "close" }
+ }
+ ,.body= ""
+ }
+
+#define NON_ASCII_IN_STATUS_LINE 11
+/* Should handle non-ASCII in status line */
+, {.name= "non-ASCII in status line"
+ ,.type= HTTP_RESPONSE
+ ,.raw= "HTTP/1.1 500 Oriƫntatieprobleem\r\n"
+ "Date: Fri, 5 Nov 2010 23:07:12 GMT+2\r\n"
+ "Content-Length: 0\r\n"
+ "Connection: close\r\n"
+ "\r\n"
+ ,.should_keep_alive= FALSE
+ ,.message_complete_on_eof= FALSE
+ ,.http_major= 1
+ ,.http_minor= 1
+ ,.status_code= 500
+ ,.num_headers= 3
+ ,.headers=
+ { { "Date", "Fri, 5 Nov 2010 23:07:12 GMT+2" }
+ , { "Content-Length", "0" }
+ , { "Connection", "close" }
+ }
+ ,.body= ""
+ }
+
+
, {.name= NULL } /* sentinel */
};