@ -593,29 +593,35 @@ const struct message requests[] =
, . body = " "
, . body = " "
}
}
# if !HTTP_PARSER_STRICT
# define PATCH_REQ 24
# define UTF8_PATH_REQ 24
, { . name = " PATCH request "
, { . name = " utf-8 path request "
, . type = HTTP_REQUEST
, . type = HTTP_REQUEST
, . raw = " GET /δ¶/δt/pope?q=1#narf HTTP/1.1 \r \n "
, . raw = " PATCH /file.txt HTTP/1.1 \r \n "
" Host: github.com \r \n "
" Host: www.example.com \r \n "
" Content-Type: application/example \r \n "
" If-Match: \" e0023aa4e \" \r \n "
" Content-Length: 10 \r \n "
" \r \n "
" \r \n "
" cccccccccc "
, . should_keep_alive = TRUE
, . should_keep_alive = TRUE
, . message_complete_on_eof = FALSE
, . message_complete_on_eof = FALSE
, . http_major = 1
, . http_major = 1
, . http_minor = 1
, . http_minor = 1
, . method = HTTP_GET
, . method = HTTP_PATCH
, . request_url = " /δ¶/δt/pope?q=1#narf "
, . request_url = " /file.txt "
, . num_headers = 1
, . num_headers = 4
, . headers = { { " Host " , " github.com " }
, . headers = { { " Host " , " www.example.com " }
, { " Content-Type " , " application/example " }
, { " If-Match " , " \" e0023aa4e \" " }
, { " Content-Length " , " 10 " }
}
}
, . body = " "
, . body = " cccccccccc "
}
}
# define HOSTNAME_UNDERSCORE 25
# define CONNECT_CAPS_REQUEST 25
, { . name = " hostname underscore "
, { . name = " connect caps request "
, . type = HTTP_REQUEST
, . type = HTTP_REQUEST
, . raw = " CONNECT home_0.netscape.com :443 HTTP/1.0\r \n "
, . raw = " CONNECT HOME0.NETSCAPE.COM :443 HTTP/1.0\r \n "
" User-agent: Mozilla/1.1N \r \n "
" User-agent: Mozilla/1.1N \r \n "
" Proxy-authorization: basic aGVsbG86d29ybGQ= \r \n "
" Proxy-authorization: basic aGVsbG86d29ybGQ= \r \n "
" \r \n "
" \r \n "
@ -624,7 +630,7 @@ const struct message requests[] =
, . http_major = 1
, . http_major = 1
, . http_minor = 0
, . http_minor = 0
, . method = HTTP_CONNECT
, . method = HTTP_CONNECT
, . request_url = " home_0.netscape.com :443"
, . request_url = " HOME0.NETSCAPE.COM :443"
, . num_headers = 2
, . num_headers = 2
, . upgrade = " "
, . upgrade = " "
, . headers = { { " User-agent " , " Mozilla/1.1N " }
, . headers = { { " User-agent " , " Mozilla/1.1N " }
@ -632,37 +638,30 @@ const struct message requests[] =
}
}
, . body = " "
, . body = " "
}
}
# endif /* !HTTP_PARSER_STRICT */
# define PATCH_REQ 26
# if !HTTP_PARSER_STRICT
, { . name = " PATCH request "
# define UTF8_PATH_REQ 26
, { . name = " utf-8 path request "
, . type = HTTP_REQUEST
, . type = HTTP_REQUEST
, . raw = " PATCH /file.txt HTTP/1.1 \r \n "
, . raw = " GET /δ¶/δt/pope?q=1#narf HTTP/1.1 \r \n "
" Host: www.example.com \r \n "
" Host: github.com \r \n "
" Content-Type: application/example \r \n "
" If-Match: \" e0023aa4e \" \r \n "
" Content-Length: 10 \r \n "
" \r \n "
" \r \n "
" cccccccccc "
, . should_keep_alive = TRUE
, . should_keep_alive = TRUE
, . message_complete_on_eof = FALSE
, . message_complete_on_eof = FALSE
, . http_major = 1
, . http_major = 1
, . http_minor = 1
, . http_minor = 1
, . method = HTTP_PATCH
, . method = HTTP_GET
, . request_url = " /file.txt "
, . request_url = " /δ¶/δt/pope?q=1#narf "
, . num_headers = 4
, . num_headers = 1
, . headers = { { " Host " , " www.example.com " }
, . headers = { { " Host " , " github.com " }
, { " Content-Type " , " application/example " }
, { " If-Match " , " \" e0023aa4e \" " }
, { " Content-Length " , " 10 " }
}
}
, . body = " cccccccccc "
, . body = " "
}
}
# define CONNECT_CAPS_REQUEST 27
# define HOSTNAME_UNDERSCORE 27
, { . name = " connect caps request "
, { . name = " hostname underscore "
, . type = HTTP_REQUEST
, . type = HTTP_REQUEST
, . raw = " CONNECT HOME0.NETSCAPE.COM :443 HTTP/1.0\r \n "
, . raw = " CONNECT home_0.netscape.com :443 HTTP/1.0\r \n "
" User-agent: Mozilla/1.1N \r \n "
" User-agent: Mozilla/1.1N \r \n "
" Proxy-authorization: basic aGVsbG86d29ybGQ= \r \n "
" Proxy-authorization: basic aGVsbG86d29ybGQ= \r \n "
" \r \n "
" \r \n "
@ -671,7 +670,7 @@ const struct message requests[] =
, . http_major = 1
, . http_major = 1
, . http_minor = 0
, . http_minor = 0
, . method = HTTP_CONNECT
, . method = HTTP_CONNECT
, . request_url = " HOME0.NETSCAPE.COM :443"
, . request_url = " home_0.netscape.com :443"
, . num_headers = 2
, . num_headers = 2
, . upgrade = " "
, . upgrade = " "
, . headers = { { " User-agent " , " Mozilla/1.1N " }
, . headers = { { " User-agent " , " Mozilla/1.1N " }
@ -679,6 +678,7 @@ const struct message requests[] =
}
}
, . body = " "
, . body = " "
}
}
# endif /* !HTTP_PARSER_STRICT */
, { . name = NULL } /* sentinel */
, { . name = NULL } /* sentinel */
} ;
} ;
@ -945,40 +945,7 @@ const struct message responses[] =
, . body = " "
, . body = " "
}
}
# define SPACE_IN_FIELD_RES 9
# define RES_FIELD_UNDERSCORE 9
/* Should handle spaces in header fields */
, { . name = " field space "
, . type = HTTP_RESPONSE
, . raw = " HTTP/1.1 200 OK \r \n "
" Server: Microsoft-IIS/6.0 \r \n "
" X-Powered-By: ASP.NET \r \n "
" en-US Content-Type: text/xml \r \n " /* this is the problem */
" Content-Type: text/xml \r \n "
" Content-Length: 16 \r \n "
" Date: Fri, 23 Jul 2010 18:45:38 GMT \r \n "
" Connection: keep-alive \r \n "
" \r \n "
" <xml>hello</xml> " /* fake body */
, . should_keep_alive = TRUE
, . message_complete_on_eof = FALSE
, . http_major = 1
, . http_minor = 1
, . status_code = 200
, . num_headers = 7
, . headers =
{ { " Server " , " Microsoft-IIS/6.0 " }
, { " X-Powered-By " , " ASP.NET " }
, { " en-US Content-Type " , " text/xml " }
, { " Content-Type " , " text/xml " }
, { " Content-Length " , " 16 " }
, { " Date " , " Fri, 23 Jul 2010 18:45:38 GMT " }
, { " Connection " , " keep-alive " }
}
, . body = " <xml>hello</xml> "
}
# define RES_FIELD_UNDERSCORE 10
/* Should handle spaces in header fields */
/* Should handle spaces in header fields */
, { . name = " field underscore "
, { . name = " field underscore "
, . type = HTTP_RESPONSE
, . type = HTTP_RESPONSE
@ -1018,7 +985,7 @@ const struct message responses[] =
, . body = " "
, . body = " "
}
}
# define NON_ASCII_IN_STATUS_LINE 1 1
# define NON_ASCII_IN_STATUS_LINE 1 0
/* Should handle non-ASCII in status line */
/* Should handle non-ASCII in status line */
, { . name = " non-ASCII in status line "
, { . name = " non-ASCII in status line "
, . type = HTTP_RESPONSE
, . type = HTTP_RESPONSE
@ -1041,7 +1008,7 @@ const struct message responses[] =
, . body = " "
, . body = " "
}
}
# define HTTP_VERSION_0_9 1 2
# define HTTP_VERSION_0_9 1 1
/* Should handle HTTP/0.9 */
/* Should handle HTTP/0.9 */
, { . name = " http version 0.9 "
, { . name = " http version 0.9 "
, . type = HTTP_RESPONSE
, . type = HTTP_RESPONSE
@ -1058,7 +1025,7 @@ const struct message responses[] =
, . body = " "
, . body = " "
}
}
# define NO_CONTENT_LENGTH_NO_TRANSFER_ENCODING_RESPONSE 1 3
# define NO_CONTENT_LENGTH_NO_TRANSFER_ENCODING_RESPONSE 1 2
/* The client should wait for the server's EOF. That is, when neither
/* The client should wait for the server's EOF. That is, when neither
* content - length nor transfer - encoding is specified , the end of body
* content - length nor transfer - encoding is specified , the end of body
* is specified by the EOF .
* is specified by the EOF .
@ -1081,7 +1048,7 @@ const struct message responses[] =
, . body = " hello world "
, . body = " hello world "
}
}
# define NO_HEADERS_NO_BODY_204 1 4
# define NO_HEADERS_NO_BODY_204 1 3
, { . name = " 204 no headers no body "
, { . name = " 204 no headers no body "
, . type = HTTP_RESPONSE
, . type = HTTP_RESPONSE
, . raw = " HTTP/1.1 204 No Content \r \n \r \n "
, . raw = " HTTP/1.1 204 No Content \r \n \r \n "
@ -1096,6 +1063,40 @@ const struct message responses[] =
, . body = " "
, . body = " "
}
}
# if !HTTP_PARSER_STRICT
# define SPACE_IN_FIELD_RES 14
/* Should handle spaces in header fields */
, { . name = " field space "
, . type = HTTP_RESPONSE
, . raw = " HTTP/1.1 200 OK \r \n "
" Server: Microsoft-IIS/6.0 \r \n "
" X-Powered-By: ASP.NET \r \n "
" en-US Content-Type: text/xml \r \n " /* this is the problem */
" Content-Type: text/xml \r \n "
" Content-Length: 16 \r \n "
" Date: Fri, 23 Jul 2010 18:45:38 GMT \r \n "
" Connection: keep-alive \r \n "
" \r \n "
" <xml>hello</xml> " /* fake body */
, . should_keep_alive = TRUE
, . message_complete_on_eof = FALSE
, . http_major = 1
, . http_minor = 1
, . status_code = 200
, . num_headers = 7
, . headers =
{ { " Server " , " Microsoft-IIS/6.0 " }
, { " X-Powered-By " , " ASP.NET " }
, { " en-US Content-Type " , " text/xml " }
, { " Content-Type " , " text/xml " }
, { " Content-Length " , " 16 " }
, { " Date " , " Fri, 23 Jul 2010 18:45:38 GMT " }
, { " Connection " , " keep-alive " }
}
, . body = " <xml>hello</xml> "
}
# endif /* !HTTP_PARSER_STRICT */
, { . name = NULL } /* sentinel */
, { . name = NULL } /* sentinel */
} ;
} ;