summaryrefslogtreecommitdiff
path: root/src/zigwebserver.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/zigwebserver.zig')
-rw-r--r--src/zigwebserver.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/zigwebserver.zig b/src/zigwebserver.zig
index acf65fb..64bd649 100644
--- a/src/zigwebserver.zig
+++ b/src/zigwebserver.zig
@@ -19,7 +19,7 @@ pub fn Server(comptime Context: type, comptime Handler: type) type {
try tp.init(.{ .allocator = self.allocator, .n_jobs = self.n_threads });
defer tp.deinit();
- var svr_internal = std.http.Server.init(self.allocator, .{ .reuse_address = true });
+ var svr_internal = std.http.Server.init(.{ .reuse_address = true });
defer svr_internal.deinit();
try svr_internal.listen(self.address);
std.log.info("server listening on {}", .{self.address});
@@ -57,7 +57,7 @@ pub fn Server(comptime Context: type, comptime Handler: type) type {
res.status = status;
res.transfer_encoding = .{ .content_length = content.len };
try res.headers.append("content-type", "text/html");
- try res.do();
+ try res.send();
try res.writer().writeAll(content);
try res.finish();
}
@@ -185,7 +185,7 @@ const RouterTest = struct {
.method = .GET,
.target = target,
};
- var res = TestResponse{
+ const res = TestResponse{
.request = req,
};
const router = TestRouter{
@@ -225,8 +225,8 @@ const RouterTest = struct {
var it = pexp.keyIterator();
var kexp = it.next();
while (kexp != null) : (kexp = it.next()) {
- var vexp = pexp.get(kexp.?.*).?;
- var maybe_vact = pact.get(kexp.?.*);
+ const vexp = pexp.get(kexp.?.*).?;
+ const maybe_vact = pact.get(kexp.?.*);
if (maybe_vact) |vact| {
std.debug.print("{s} {s}", .{ vexp, vact });
try std.testing.expectEqual(vexp, vact);