feat: introduce fluent emoji
This commit is contained in:
		@@ -217,6 +217,21 @@ export class ClientServerService {
 | 
			
		||||
			return reply.sendFile('/apple-touch-icon.png', staticAssets);
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		fastify.get<{ Params: { path: string } }>('/fluent-emoji/:path(.*)', async (request, reply) => {
 | 
			
		||||
			const path = request.params.path;
 | 
			
		||||
 | 
			
		||||
			if (!path.match(/^[0-9a-f-]+\.png$/)) {
 | 
			
		||||
				reply.code(404);
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			reply.header('Content-Security-Policy', 'default-src \'none\'; style-src \'unsafe-inline\'');
 | 
			
		||||
 | 
			
		||||
			return await reply.sendFile(path, `${_dirname}/../../../../../fluent-emojis/dist/`, {
 | 
			
		||||
				maxAge: ms('30 days'),
 | 
			
		||||
			});
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		fastify.get<{ Params: { path: string } }>('/twemoji/:path(.*)', async (request, reply) => {
 | 
			
		||||
			const path = request.params.path;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user