MCPcopy Create free account
hub / github.com/Preloading/TwitterAPIBridge / RedirectToLink

Function RedirectToLink

twitterv1/imagelink.go:89–98  ·  view source on GitHub ↗
(c *fiber.Ctx)

Source from the content-addressed store, hash-verified

87}
88
89func 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}

Callers

nothing calls this directly

Calls 1

GetOriginalURLFunction · 0.92

Tested by

no test coverage detected