From 6e206be5b6f14154f1a93f5cab0833e0b8b64e82 Mon Sep 17 00:00:00 2001 From: Rene Schallner Date: Sun, 16 Apr 2023 23:45:23 +0200 Subject: [PATCH] doc fixup --- doc/authentication.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/authentication.md b/doc/authentication.md index 2472b24..a215b06 100644 --- a/doc/authentication.md +++ b/doc/authentication.md @@ -196,12 +196,15 @@ const zap = @import("zap"); const a = std.heap.page_allocator; const token = "ABCDEFG"; +const HTTP_RESPONSE: []const u8 = + \\ + \\ Hello from ZAP!!! + \\ + // authenticated requests go here fn endpoint_http_get(e: *zap.SimpleEndpoint, r: zap.SimpleRequest) void { _ = e; r.sendBody(HTTP_RESPONSE) catch return; - received_response = HTTP_RESPONSE; - zap.fio_stop(); } // just for fun, we also catch the unauthorized callback @@ -209,9 +212,6 @@ fn endpoint_http_unauthorized(e: *zap.SimpleEndpoint, r: zap.SimpleRequest) void _ = e; r.setStatus(.unauthorized); r.sendBody("UNAUTHORIZED ACCESS") catch return; - std.debug.print("\nunauthorized\n", .{}); - received_response = "UNAUTHORIZED"; - zap.fio_stop(); }