Skip to content

Commit

Permalink
Remove std.http.Server.Request from context
Browse files Browse the repository at this point in the history
  • Loading branch information
dravenk committed Oct 24, 2024
1 parent 9b0e7f4 commit 61231c7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/zinc/context.zig
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ const handlerFn = *const fn (*Context) anyerror!void;

allocator: std.mem.Allocator,

server_request: *std.http.Server.Request = undefined,

request: *Request = undefined,
response: *Response = undefined,

Expand Down
2 changes: 1 addition & 1 deletion src/zinc/router.zig
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn handleContext(self: *Self, ctx: *Context) anyerror!void {
pub fn handleRequest(self: *Self, allocator: std.mem.Allocator, request: *std.http.Server.Request) anyerror!void {
const req = try Request.init(.{ .req = request, .allocator = allocator });
const res = try Response.init(.{ .req = request, .allocator = allocator });
const ctx = try Context.init(.{ .request = req, .response = res, .server_request = request, .allocator = allocator });
const ctx = try Context.init(.{ .request = req, .response = res, .allocator = allocator });
defer ctx.destroy();

const match_route = self.getRoute(request.head.method, request.head.target) catch |err| {
Expand Down

0 comments on commit 61231c7

Please sign in to comment.