handle invalid pdf params

This commit is contained in:
Yisroel Baum 2026-06-26 10:15:19 +03:00
parent d48c854e42
commit 78e713a8ce
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -31,11 +31,11 @@ class GetElementPdf
} }
if (!$this->isAllowedPdfFolder($request->folder)) { if (!$this->isAllowedPdfFolder($request->folder)) {
throw new NotFoundException('PDF not found'); throw new BadRequestException('folder is invalid');
} }
if (!$this->isValidPdfFileName($request->fileName)) { if (!$this->isValidPdfFileName($request->fileName)) {
throw new NotFoundException('PDF not found'); throw new BadRequestException('fileName is invalid');
} }
$path = "element-pdfs/$request->folder/$request->fileName"; $path = "element-pdfs/$request->folder/$request->fileName";