Add secure field to HTTP_Request to mark whether the underlying connection uses TLS or not
This commit is contained in:
+2
-4
@@ -1003,6 +1003,8 @@ static int parse_request(Scanner *s, HTTP_Request *req)
|
||||
if (!contains_head(s->src + s->cur, s->len - s->cur))
|
||||
return 0;
|
||||
|
||||
req->secure = false;
|
||||
|
||||
if (0) {}
|
||||
else if (consume_str(s, HTTP_STR("GET "))) req->method = HTTP_METHOD_GET;
|
||||
else if (consume_str(s, HTTP_STR("POST "))) req->method = HTTP_METHOD_POST;
|
||||
@@ -1015,10 +1017,6 @@ static int parse_request(Scanner *s, HTTP_Request *req)
|
||||
else if (consume_str(s, HTTP_STR("PATCH "))) req->method = HTTP_METHOD_PATCH;
|
||||
else return -1;
|
||||
|
||||
if (s->cur == s->len || s->src[s->cur] != ' ')
|
||||
return -1;
|
||||
s->cur++;
|
||||
|
||||
{
|
||||
Scanner s2 = *s;
|
||||
int peek = s->cur;
|
||||
|
||||
Reference in New Issue
Block a user