Return 404 if the comic is not found

This commit is contained in:
Luis Ángel San Martín
2024-08-29 19:01:48 +02:00
parent c5924e625b
commit a3f3149764
4 changed files with 27 additions and 3 deletions

View File

@ -22,6 +22,12 @@ void ComicDownloadInfoControllerV2::service(HttpRequest &request, HttpResponse &
ComicDB comic = DBHelper::getComicInfo(libraryId, comicId);
if (!comic.info.existOnDb) {
response.setStatus(404, "Not Found");
response.write("", true);
return;
}
// TODO: check if the comic wasn't found;
response.write(QString("fileName:%1\r\n").arg(comic.getFileName()).toUtf8());
response.write(QString("fileSize:%1\r\n").arg(comic.getFileSize()).toUtf8());