Merged development into master

This commit is contained in:
NelsonLaQuet 2013-09-01 03:08:12 -05:00
commit d04a3e126e
2 changed files with 16 additions and 2 deletions

View file

@ -2,6 +2,8 @@
return array(
'sendfile' => false,
/*
|--------------------------------------------------------------------------
| Application Debug Mode

View file

@ -75,7 +75,13 @@
ResourceLogItem::logItem('track', $id, ResourceLogItem::PLAY, $format['index']);
$response = Response::make('', 200);
$response->header('X-Sendfile', $track->getFileFor('MP3'));
if (Config::get('app.sendfile')) {
$response->header('X-Sendfile', $track->getFileFor('MP3'));
} else {
$response->header('X-Accel-Redirect', $track->getFileFor('MP3'));
}
$response->header('Content-Disposition', 'filename="' . $track->getFilenameFor('MP3') . '"');
$response->header('Content-Type', $format['mime_type']);
@ -104,7 +110,13 @@
ResourceLogItem::logItem('track', $id, ResourceLogItem::DOWNLOAD, $format['index']);
$response = Response::make('', 200);
$response->header('X-Sendfile', $track->getFileFor($formatName));
if (Config::get('app.sendfile')) {
$response->header('X-Sendfile', $track->getFileFor('MP3'));
} else {
$response->header('X-Accel-Redirect', $track->getFileFor('MP3'));
}
$response->header('Content-Disposition', 'attachment; filename="' . $track->getDownloadFilenameFor($formatName) . '"');
$response->header('Content-Type', $format['mime_type']);