MCPcopy Create free account
hub / github.com/SmolDapp/tokenAssets / ServeChain

Function ServeChain

_config/goAPI/serveChain.go:12–24  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

10func ServeChain(c *gin.Context) {
11 chainIDStr := c.Param("chainID")
12 fileName := c.Param("filename")
13
14 if !ContainsSubString([]string{"logo.svg", "logo-32.png", "logo-128.png"}, fileName) {
15 resolveFallback(c, `/_config/nodeAPI/public/not-found.png`)
16 return
17 }
18
19 targetURL := fmt.Sprintf("%s/chains/%s/%s", RedirectBaseURI(), chainIDStr, fileName)
20 c.Header(`Cache-Control`, REDIRECT_CACHE_CONTROL)
21 c.Redirect(http.StatusTemporaryRedirect, targetURL)
22 c.Abort()
23}

Callers

nothing calls this directly

Calls 2

ContainsSubStringFunction · 0.85
resolveNotFoundFunction · 0.70

Tested by

no test coverage detected