Adapting the HTTP request line parsing to only accept methods

consisting of letters [A-Za-z].

I had some bogus HTTP sessions now with the test-suite that reported
data as HTTP because it started with "<!... ". Requiring letters seems
a reasonable constraint.
This commit is contained in:
Robin Sommer 2012-12-05 16:44:04 -08:00
parent c8d264f105
commit 57510464a1
6 changed files with 77 additions and 43 deletions

View file

@ -95,7 +95,9 @@ export {
"PROXY-CONNECTION",
} &redef;
## A list of HTTP methods. Other methods will generate a weird.
## A list of HTTP methods. Other methods will generate a weird. Note
## that the HTTP analyzer will only accept methods consisting solely
## of letters ``[A-Za-z]``.
const http_methods: set[string] = {
"GET", "POST", "HEAD", "OPTIONS",
"PUT", "DELETE", "TRACE", "CONNECT",