mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update MediaStorageService, improve head checks to fix failed jobs
This commit is contained in:
parent
850e4499f1
commit
1769cdfd74
1 changed files with 11 additions and 0 deletions
|
@ -40,7 +40,18 @@ class MediaStorageService {
|
|||
} catch (RequestException $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$h = $r->getHeaders();
|
||||
|
||||
if (isset($h['Content-Length'], $h['Content-Type']) == false ||
|
||||
empty($h['Content-Length']) ||
|
||||
empty($h['Content-Type']) ||
|
||||
$h['Content-Length'] < 10 ||
|
||||
$h['Content-Length'] > (config('pixelfed.max_photo_size') * 1000)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return [
|
||||
'length' => $h['Content-Length'][0],
|
||||
'mime' => $h['Content-Type'][0]
|
||||
|
|
Loading…
Reference in a new issue