From a6934445e81c20b1339291db9df9781bbd0ff1c7 Mon Sep 17 00:00:00 2001 From: Jon Kolb Date: Sat, 18 Jun 2011 13:46:29 -0400 Subject: [PATCH] Allow uppercase chars in IS_ALPHANUM --- http_parser.c | 2 +- test.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/http_parser.c b/http_parser.c index 8877959..cfa2e55 100644 --- a/http_parser.c +++ b/http_parser.c @@ -302,7 +302,7 @@ enum header_states #define TOKEN(c) (tokens[(unsigned char)c]) #define IS_ALPHA(c) ((c) >= 'a' && (c) <= 'z') #define IS_NUM(c) ((c) >= '0' && (c) <= '9') -#define IS_ALPHANUM(c) (IS_ALPHA(c) || IS_NUM(c)) +#define IS_ALPHANUM(c) (IS_ALPHA(LOWER(c)) || IS_NUM(c)) #if HTTP_PARSER_STRICT #define IS_URL_CHAR(c) (normal_url_char[(unsigned char) (c)]) diff --git a/test.c b/test.c index 34bbafb..b1d2e7b 100644 --- a/test.c +++ b/test.c @@ -744,6 +744,30 @@ const struct message requests[] = ,.body= "cccccccccc" } +#define CONNECT_CAPS_REQUEST 27 +, {.name = "connect caps request" + ,.type= HTTP_REQUEST + ,.raw= "CONNECT 0-HOME0.NETSCAPE.COM:443 HTTP/1.0\r\n" + "User-agent: Mozilla/1.1N\r\n" + "Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n" + "\r\n" + ,.should_keep_alive= FALSE + ,.message_complete_on_eof= FALSE + ,.http_major= 1 + ,.http_minor= 0 + ,.method= HTTP_CONNECT + ,.query_string= "" + ,.fragment= "" + ,.request_path= "" + ,.request_url= "0-HOME0.NETSCAPE.COM:443" + ,.num_headers= 2 + ,.upgrade=1 + ,.headers= { { "User-agent", "Mozilla/1.1N" } + , { "Proxy-authorization", "basic aGVsbG86d29ybGQ=" } + } + ,.body= "" + } + , {.name= NULL } /* sentinel */ };