From 3b32adea27e92ece5cea72d6590d8f25a19e0dff Mon Sep 17 00:00:00 2001 From: "L. Pereira" Date: Sat, 12 Oct 2024 15:39:19 -0700 Subject: [PATCH] Only create new paste entry if none existed with that key --- src/samples/pastebin/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/samples/pastebin/main.c b/src/samples/pastebin/main.c index 5074e3c85..3b677c4e4 100644 --- a/src/samples/pastebin/main.c +++ b/src/samples/pastebin/main.c @@ -84,6 +84,9 @@ static enum lwan_http_status post_paste(struct lwan_request *request, pastes, request->conn->coro, key, (void *)body); if (paste) { + if (!cache_entry_is_new(paste)) + continue; + const char *host_hdr = lwan_request_get_host(request); if (!host_hdr)