diff --git a/src/Controllers/PostContentController.php b/src/Controllers/PostContentController.php index 64bd38c4..ae8c58d7 100644 --- a/src/Controllers/PostContentController.php +++ b/src/Controllers/PostContentController.php @@ -2,6 +2,7 @@ namespace Szurubooru\Controllers; use Szurubooru\Config; use Szurubooru\Dao\PublicFileDao; +use Szurubooru\Entities\Post; use Szurubooru\Helpers\MimeHelper; use Szurubooru\Router; use Szurubooru\Services\NetworkingService; @@ -45,6 +46,12 @@ final class PostContentController extends AbstractController $post->getName(), strtolower(MimeHelper::getExtension($post->getContentMimeType()))); + if ($post->getContentType() === Post::POST_TYPE_YOUTUBE) + { + $this->networkingService->nonCachedRedirect($post->getOriginalFileName()); + return; + } + $this->networkingService->serveFile($this->fileDao->getFullPath($post->getContentPath()), $customFileName); }