koel/app/Http/Requests/API/UploadRequest.php
Tony Wasserka c9446c4adb
Recognize the standard MIME type for uploaded FLAC audio (#1290)
Before this change, Koel only recognized the non-standard MIME type audio/x-flac.

Server-side portion of https://github.com/koel/core/pull/53.
2021-04-11 19:51:36 +02:00

27 lines
575 B
PHP

<?php
namespace App\Http\Requests\API;
use App\Http\Requests\AbstractRequest;
use Illuminate\Http\UploadedFile;
/** @property UploadedFile $file */
class UploadRequest extends AbstractRequest
{
public function authorize(): bool
{
return auth()->user()->is_admin;
}
/** @return array<mixed> */
public function rules(): array
{
return [
'file' => [
'required',
'file',
'mimetypes:audio/flac,audio/mpeg,audio/ogg,audio/x-flac,audio/x-aac',
],
];
}
}