(c *fiber.Ctx)
| 87 | } |
| 88 | |
| 89 | func RedirectToLink(c *fiber.Ctx) error { |
| 90 | |
| 91 | shortCode := c.Params("ref") |
| 92 | originalURL, err := db_controller.GetOriginalURL(shortCode) |
| 93 | if err != nil { |
| 94 | return c.Status(fiber.StatusNotFound).SendString("Could not find image!") |
| 95 | } |
| 96 | |
| 97 | return c.Redirect(configData.CdnURL+originalURL, fiber.StatusMovedPermanently) |
| 98 | } |
nothing calls this directly
no test coverage detected