verify that preview URL is valid

This commit is contained in:
Hazelnoot 2024-11-18 10:41:18 -05:00 committed by fly_mc
parent c8a1940a14
commit d1965bf9a3

View file

@ -52,7 +52,7 @@ export class UrlPreviewService {
reply: FastifyReply,
): Promise<object | undefined> {
const url = request.query.url;
if (typeof url !== 'string') {
if (typeof url !== 'string' || !URL.canParse(url)) {
reply.code(400);
return;
}