Skip to content

Commit

Permalink
Only create new paste entry if none existed with that key
Browse files Browse the repository at this point in the history
  • Loading branch information
lpereira committed Oct 12, 2024
1 parent 5610440 commit 3b32ade
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/samples/pastebin/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3b32ade

Please sign in to comment.