Allow quotes in URI
IE6 apparently sends such requests... Reported by Michael Carter.
diff --git a/http_parser.rl b/http_parser.rl
index 0d8fa50..bf2da13 100644
--- a/http_parser.rl
+++ b/http_parser.rl
@@ -312,7 +312,7 @@
national = any -- (alpha | digit | reserved | extra | safe | unsafe);
unreserved = (alpha | digit | safe | extra | national);
escape = ("%" xdigit xdigit);
- uchar = (unreserved | escape);
+ uchar = (unreserved | escape | "\"");
pchar = (uchar | ":" | "@" | "&" | "=" | "+");
tspecials = ("(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\\" | "\""
| "/" | "[" | "]" | "?" | "=" | "{" | "}" | " " | "\t");
diff --git a/test.c b/test.c
index ba8329f..5405f63 100644
--- a/test.c
+++ b/test.c
@@ -302,6 +302,21 @@
,.body= "hello world"
}
+#define WITH_QUOTES 12
+, {.name= "with quotes"
+ ,.type= HTTP_REQUEST
+ ,.raw= "GET /with_\"stupid\"_quotes?foo=\"bar\" HTTP/1.1\r\n\r\n"
+ ,.should_keep_alive= TRUE
+ ,.method= HTTP_GET
+ ,.query_string= "foo=\"bar\""
+ ,.fragment= ""
+ ,.request_path= "/with_\"stupid\"_quotes"
+ ,.request_uri= "/with_\"stupid\"_quotes?foo=\"bar\""
+ ,.num_headers= 0
+ ,.headers= { }
+ ,.body= ""
+ }
+
, {.name= NULL } /* sentinel */
};