MCPcopy Index your code
hub / github.com/github/docs / favicons

Function favicons

middleware/favicons.js:38–52  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

36}
37
38export default function favicons(req, res, next) {
39 if (!MAP[req.path]) return next()
40
41 // This makes sure the CDN caching survives each production deployment.
42 setFastlySurrogateKey(res, SURROGATE_ENUMS.MANUAL)
43
44 // Manually settings a Cache-Control because no other middleware
45 // will get a chance to do this later since we terminate here.
46 assetCacheControl(res)
47
48 const { contentType, buffer } = MAP[req.path]
49 res.set('content-type', contentType)
50
51 res.send(buffer())
52}

Callers

nothing calls this directly

Calls 2

setFastlySurrogateKeyFunction · 0.90
nextFunction · 0.50

Tested by

no test coverage detected