fix: favicon not found (#14598)
This commit is contained in:
@@ -79,4 +79,10 @@ describe('router', () => {
|
||||
expect(await response.text()).toBe('User-agent: *\nDisallow: /');
|
||||
expect(response.headers.get('content-type')).toBe('text/plain');
|
||||
});
|
||||
|
||||
// favicon.ico
|
||||
it('/favicon.ico', async () => {
|
||||
const response = await app.request('/favicon.ico');
|
||||
expect(response.status).toBe(200);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -48,6 +48,7 @@ export default function (app: Hono) {
|
||||
'/*',
|
||||
serveStatic({
|
||||
root: './lib/assets',
|
||||
rewriteRequestPath: (path) => (path === '/favicon.ico' ? '/favicon.png' : path),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user