aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorspl3g <spleefer6@yandex.ru>2025-03-24 22:47:47 +0300
committerspl3g <spleefer6@yandex.ru>2025-03-24 22:48:21 +0300
commit57801baf56024f0e209e850cf7a7ec1eb7377649 (patch)
tree8027e8139f02205b4409624fa6d4cf21432cbf89 /src
parente4d28f68a05ae0a9cd48ab811d478b10b2f75e64 (diff)
Add version to the request struct
Diffstat (limited to 'src')
-rw-r--r--src/http.c3
1 files changed, 2 insertions, 1 deletions
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;