Support request URLs without schema

Test case from Poul T Lomholt <pt@lomholt.com>
event_stream
Ryan Dahl 15 years ago
parent cdda8b6a60
commit 4cf39fd2fa

@ -687,6 +687,9 @@ size_t http_parser_execute (http_parser *parser,
if (ch == ':') { if (ch == ':') {
state = s_req_schema_slash; state = s_req_schema_slash;
break; break;
} else if (ch == '.') {
state = s_req_host;
break;
} }
goto error; goto error;

@ -495,6 +495,30 @@ const struct message requests[] =
,.body= "" ,.body= ""
} }
#define CONNECT_REQUEST 17
, {.name = "connect request"
,.type= HTTP_REQUEST
,.raw= "CONNECT home.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= "home.netscape.com:443"
,.num_headers= 2
,.upgrade=0
,.headers= { { "User-agent", "Mozilla/1.1N" }
, { "Proxy-authorization", "basic aGVsbG86d29ybGQ=" }
}
,.body= ""
}
, {.name= NULL } /* sentinel */ , {.name= NULL } /* sentinel */
}; };

Loading…
Cancel
Save