Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -80,15 +80,18 @@ try
|
||||
\IPS\Db::i()->update( 'core_attachments', "attach_hits=attach_hits+1", array( 'attach_id=?', $attachment['attach_id'] ) );
|
||||
|
||||
/* If it's an AWS file just redirect to it */
|
||||
if ( $file instanceof \IPS\File\Amazon )
|
||||
if ( $signedUrl = $file->generateTemporaryDownloadUrl() )
|
||||
{
|
||||
\IPS\Output::i()->redirect( $file->generateTemporaryDownloadUrl() );
|
||||
\IPS\Output::i()->redirect( $signedUrl );
|
||||
}
|
||||
|
||||
/* Send headers and print file */
|
||||
\IPS\Output::i()->sendStatusCodeHeader( 200 );
|
||||
\IPS\Output::i()->sendHeader( "Content-type: " . \IPS\File::getMimeType( $file->originalFilename ) . ";charset=UTF-8" );
|
||||
|
||||
\IPS\Output::i()->sendHeader( "Content-Security-Policy: default-src 'none'; sandbox" );
|
||||
\IPS\Output::i()->sendHeader( "X-Content-Security-Policy: default-src 'none'; sandbox" );
|
||||
|
||||
foreach( $headers as $key => $header )
|
||||
{
|
||||
\IPS\Output::i()->sendHeader( $key . ': ' . $header );
|
||||
|
||||
Reference in new issue
Block a user