mirror of
https://github.com/nodejs/http-parser.git
synced 2025-10-18 18:27:24 +08:00
Digits in hostname on CONNECT req allowed
This commit is contained in:
@@ -658,6 +658,9 @@ size_t http_parser_execute (http_parser *parser,
|
||||
} else if (ch == '.') {
|
||||
state = s_req_host;
|
||||
break;
|
||||
} else if ('0' <= ch && ch <= '9') {
|
||||
state = s_req_host;
|
||||
break;
|
||||
}
|
||||
|
||||
goto error;
|
||||
|
4
test.c
4
test.c
@@ -498,7 +498,7 @@ const struct message requests[] =
|
||||
#define CONNECT_REQUEST 17
|
||||
, {.name = "connect request"
|
||||
,.type= HTTP_REQUEST
|
||||
,.raw= "CONNECT home.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"
|
||||
"Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n"
|
||||
"\r\n"
|
||||
@@ -510,7 +510,7 @@ const struct message requests[] =
|
||||
,.query_string= ""
|
||||
,.fragment= ""
|
||||
,.request_path= ""
|
||||
,.request_url= "home.netscape.com:443"
|
||||
,.request_url= "home0.netscape.com:443"
|
||||
,.num_headers= 2
|
||||
,.upgrade=1
|
||||
,.headers= { { "User-agent", "Mozilla/1.1N" }
|
||||
|
Reference in New Issue
Block a user