MCPcopy Create free account
hub / github.com/tinyhttp/tinyhttp / createIcon

Function createIcon

packages/favicon/src/index.ts:33–39  ·  view source on GitHub ↗
(buf: Buffer, maxAge: number)

Source from the content-addressed store, hash-verified

31}
32
33const createIcon = (buf: Buffer, maxAge: number): FaviconBody => ({
34 body: buf,
35 headers: {
36 'Cache-Control': 'public, max-age=' + Math.floor(maxAge / 1000),
37 ETag: eTag(buf)
38 }
39})
40
41function createIsDirError(path: string) {
42 const error: NodeJS.ErrnoException = new Error(`EISDIR, illegal operation on directory '${path}' `)

Callers 1

faviconFunction · 0.85

Calls 1

eTagFunction · 0.90

Tested by

no test coverage detected