1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

improve error handling for document downloads

This commit is contained in:
David Bomba 2016-08-03 23:02:42 +10:00
parent d64f18ef99
commit e393b891bd

View File

@ -52,8 +52,10 @@ class DocumentAPIController extends BaseAPIController
{ {
$document = $request->entity(); $document = $request->entity();
if(array_key_exists($document->type, Document::$types))
return DocumentController::getDownloadResponse($document); return DocumentController::getDownloadResponse($document);
} else
return $this->errorResponse(['error'=>'Invalid mime type'],400); }
/** /**
* @param CreateDocumentRequest $request * @param CreateDocumentRequest $request