From 1769cdfd743a85a37d1234273a43940646c97573 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 17 Feb 2021 01:09:39 -0700 Subject: [PATCH 1/2] Update MediaStorageService, improve head checks to fix failed jobs --- app/Services/MediaStorageService.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Services/MediaStorageService.php b/app/Services/MediaStorageService.php index 5d301dd9..1618af1a 100644 --- a/app/Services/MediaStorageService.php +++ b/app/Services/MediaStorageService.php @@ -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] From 7b7e7cf697280c6948c2f40be82554cbee9d4e04 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 17 Feb 2021 01:14:24 -0700 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f9fb045..8d8f202e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,7 @@ - Updated pixelfed config, add media_fast_process setting. ([6bee5072](https://github.com/pixelfed/pixelfed/commit/6bee5072)) - Updated ComposeController, add mediaProcessingCheck method. ([33b625f5](https://github.com/pixelfed/pixelfed/commit/33b625f5)) - Updated ComposeModal, add processing step disabled by default. ([e6e76e80](https://github.com/pixelfed/pixelfed/commit/e6e76e80)) -- Updated DiscoverComponent, allow unathenicated if enabled. ([a1059a6e](https://github.com/pixelfed/pixelfed/commit/a1059a6e)) +- Updated DiscoverComponent, allow unauthenticated if enabled. ([a1059a6e](https://github.com/pixelfed/pixelfed/commit/a1059a6e)) - Updated components, improve content warnings. ([a9e98965](https://github.com/pixelfed/pixelfed/commit/a9e98965)) - Updated ComposeModal, prevent tagging empty users. Fixes #2633. ([ceae664c](https://github.com/pixelfed/pixelfed/commit/ceae664c)) - Updated ComposeModal, show filter warning for unsupported browsers. ([12ce7602](https://github.com/pixelfed/pixelfed/commit/12ce7602)) @@ -46,6 +46,7 @@ - Updated Status model, refactor liked and shared methods to fix cache invalidation bug. ([f05c3b66](https://github.com/pixelfed/pixelfed/commit/f05c3b66)) - Updated Timeline component, add inline reports modal. ([e64b4bd3](https://github.com/pixelfed/pixelfed/commit/e64b4bd3)) - Updated federation pipeline, add locks. ([ddc76887](https://github.com/pixelfed/pixelfed/commit/ddc76887)) +- Updated MediaStorageService, improve head checks to fix failed jobs. ([1769cdfd](https://github.com/pixelfed/pixelfed/commit/1769cdfd)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10)