From 5edaacde07882567ba0c5d23b3d054246c941a21 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Tue, 3 Oct 2023 13:44:47 -0700 Subject: [PATCH] add target to flexilib interface --- src/flexilib-interface.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/flexilib-interface.zig b/src/flexilib-interface.zig index 43160e9..751532e 100644 --- a/src/flexilib-interface.zig +++ b/src/flexilib-interface.zig @@ -17,6 +17,9 @@ pub const Response = extern struct { }; pub const Request = extern struct { + target: [*]const u8, + target_len: usize, + method: [*:0]u8, method_len: usize, @@ -33,6 +36,7 @@ threadlocal var allocator: ?*std.mem.Allocator = null; const log = std.log.scoped(.interface); pub const ZigRequest = struct { + target: []const u8, method: [:0]u8, content: []u8, headers: []Header, @@ -104,6 +108,7 @@ pub fn handleRequest(request: *Request, zigRequestHandler: ZigRequestHandler) ?* zigRequestHandler( alloc, .{ + .target = request.target[0..request.target_len], .method = request.method[0..request.method_len :0], .content = request.content[0..request.content_len], .headers = request.headers[0..request.headers_len],