From 17a9c5835e1683f7d1b508f5bfa94fc69ea420d5 Mon Sep 17 00:00:00 2001 From: tijl Date: Wed, 6 Aug 2025 19:31:38 +0200 Subject: [PATCH] up --- serve.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serve.go b/serve.go index ed30bea..95e8f13 100644 --- a/serve.go +++ b/serve.go @@ -23,6 +23,9 @@ func (s *Server) Admin() *fiber.App { a.Post("/shorten", func(c *fiber.Ctx) error { shortUrl := c.Query("s") + if shortUrl == "" { + shortUrl = s.serverGen.NextID() + } longUrl := string(c.Body()) return s.storage.Put(shortUrl, longUrl)