From 2c0b39c2d2512c721c8c602317043072f49c5f3a Mon Sep 17 00:00:00 2001 From: Jacob Gunther Date: Thu, 10 Mar 2022 20:01:43 -0600 Subject: [PATCH] Send 404 on UUID route when not found --- src/routes/uuid.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/routes/uuid.go b/src/routes/uuid.go index a57c1a9..fb77541 100644 --- a/src/routes/uuid.go +++ b/src/routes/uuid.go @@ -22,5 +22,12 @@ func UUIDHandler(ctx *fasthttp.RequestCtx) { return } + if len(uuid) < 1 { + ctx.SetStatusCode(404) + ctx.SetBodyString(http.StatusText(http.StatusNotFound)) + + return + } + ctx.SetBodyString(uuid) }