From da4b9684b4280c0a054da6606eaa5188de5ee66f Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Sun, 22 Jan 2023 10:21:03 +0100 Subject: [PATCH] Log RAW request for #867 --- .../v/0.0.0/app/libraries/RainLoop/Actions/Raw.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php index 7c133429f..167b67566 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Raw.php @@ -156,8 +156,7 @@ trait Raw $sFileNameOut = $this->MainClearFileName($sFileNameIn, $sContentTypeIn, $sMimeIndex); $rResource = $this->FilesProvider()->GetFile($oAccount, $sFileHashIn); - if (\is_resource($rResource)) - { + if (\is_resource($rResource)) { \header('Content-Type: '.$sContentTypeOut); \header('Content-Disposition: attachment; '. \trim(\MailSo\Base\Utils::EncodeHeaderUtf8AttributeValue('filename', $sFileNameOut))); @@ -181,14 +180,21 @@ trait Raw $self = $this; return $this->MailClient()->MessageMimeStream( function($rResource, $sContentType, $sFileName, $sMimeIndex = '') use ( - $self, $oAccount, $sRawKey, $sContentTypeIn, $sFileNameIn, $bDownload, $bThumbnail, + $self, $sRawKey, $sContentTypeIn, $sFileNameIn, $bDownload, $bThumbnail, $bIsRangeRequest, $sRangeStart, $sRangeEnd ) { - if ($oAccount && \is_resource($rResource)) { + if (\is_resource($rResource)) { \MailSo\Base\Utils::ResetTimeLimit(); $self->cacheByKey($sRawKey); + $self->Logger()->Write(\print_r([ + $sFileName, + $sContentType, + $sFileNameIn, + $sContentTypeIn + ],true), \LOG_DEBUG, 'RAW'); + if ($sFileNameIn) { $sFileName = $sFileNameIn; }