|
|
@ -3117,16 +3117,7 @@ main (void)
|
|
|
|
|
|
|
|
|
|
|
|
/// REQUESTS
|
|
|
|
/// REQUESTS
|
|
|
|
|
|
|
|
|
|
|
|
test_simple("hello world", HPE_INVALID_METHOD);
|
|
|
|
|
|
|
|
test_simple("GET / HTP/1.1\r\n\r\n", HPE_INVALID_VERSION);
|
|
|
|
test_simple("GET / HTP/1.1\r\n\r\n", HPE_INVALID_VERSION);
|
|
|
|
test_simple("GEM / HTTP/1.1\r\n\r\n", HPE_INVALID_METHOD);
|
|
|
|
|
|
|
|
test_simple("PUN / HTTP/1.1\r\n\r\n", HPE_INVALID_METHOD);
|
|
|
|
|
|
|
|
test_simple("PX / HTTP/1.1\r\n\r\n", HPE_INVALID_METHOD);
|
|
|
|
|
|
|
|
test_simple("SA / HTTP/1.1\r\n\r\n", HPE_INVALID_METHOD);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test_simple("ASDF / HTTP/1.1\r\n\r\n", HPE_INVALID_METHOD);
|
|
|
|
|
|
|
|
test_simple("PROPPATCHA / HTTP/1.1\r\n\r\n", HPE_INVALID_METHOD);
|
|
|
|
|
|
|
|
test_simple("GETA / HTTP/1.1\r\n\r\n", HPE_INVALID_METHOD);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Well-formed but incomplete
|
|
|
|
// Well-formed but incomplete
|
|
|
|
test_simple("GET / HTTP/1.1\r\n"
|
|
|
|
test_simple("GET / HTTP/1.1\r\n"
|
|
|
@ -3170,13 +3161,23 @@ main (void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const char *bad_methods[] = {
|
|
|
|
static const char *bad_methods[] = {
|
|
|
|
|
|
|
|
"ASDF",
|
|
|
|
"C******",
|
|
|
|
"C******",
|
|
|
|
|
|
|
|
"COLA",
|
|
|
|
|
|
|
|
"GEM",
|
|
|
|
|
|
|
|
"GETA",
|
|
|
|
"M****",
|
|
|
|
"M****",
|
|
|
|
|
|
|
|
"MKCOLA",
|
|
|
|
|
|
|
|
"PROPPATCHA",
|
|
|
|
|
|
|
|
"PUN",
|
|
|
|
|
|
|
|
"PX",
|
|
|
|
|
|
|
|
"SA",
|
|
|
|
|
|
|
|
"hello world",
|
|
|
|
0 };
|
|
|
|
0 };
|
|
|
|
for (this_method = bad_methods; *this_method; this_method++) {
|
|
|
|
for (this_method = bad_methods; *this_method; this_method++) {
|
|
|
|
char buf[200];
|
|
|
|
char buf[200];
|
|
|
|
sprintf(buf, "%s / HTTP/1.1\r\n\r\n", *this_method);
|
|
|
|
sprintf(buf, "%s / HTTP/1.1\r\n\r\n", *this_method);
|
|
|
|
test_simple(buf, HPE_UNKNOWN);
|
|
|
|
test_simple(buf, HPE_INVALID_METHOD);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const char *dumbfuck2 =
|
|
|
|
const char *dumbfuck2 =
|
|
|
|