aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/chttp/http.h1
-rw-r--r--src/http.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/include/chttp/http.h b/include/chttp/http.h
index 4fcc418..937f93e 100644
--- a/include/chttp/http.h
+++ b/include/chttp/http.h
@@ -65,6 +65,7 @@ typedef struct {
size_t inc_fd;
const_string method;
const_string path;
+ const_string version;
http_query_da query;
header_da headers;
const_string body;
diff --git a/src/http.c b/src/http.c
index db497d5..5bb1702 100644
--- a/src/http.c
+++ b/src/http.c
@@ -410,7 +410,7 @@ int parse_request(arena *arena, size_t inc_fd, http_request *req) {
const_string method = chop_request(&req_str, ' ', &parse_err);
const_string path = chop_request(&req_str, ' ', &parse_err);
- chop_request(&req_str, '\r', &parse_err);
+ const_string version = chop_request(&req_str, '\r', &parse_err);
req_str.data += 1;
header_da headers = {0};
@@ -440,6 +440,7 @@ int parse_request(arena *arena, size_t inc_fd, http_request *req) {
req->method = method;
req->path = path;
+ req->version = version;
req->query = queries;
req->headers = headers;
req->body = req_str;