From c01b5fa5c7f14f332d232e0fdc91da528d697350 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Thu, 24 May 2018 13:59:08 +0200 Subject: [PATCH] Allow nzb downloads for not logged in users (sab/nzbget are not logged in) --- Changelog | 1 + app/Http/Controllers/BasePageController.php | 2 +- app/Http/Controllers/GetNzbController.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 3d1d31d80..9af9971ba 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-05-24 DariusIII + * Chg: Allow nzb downloads for not logged in users (sab/nzbget are not logged in) * Chg: Potential fix for sent emails reply to field * Fix: Fix advanced search * Chg: Do not send google recaptcha response inside contact email message diff --git a/app/Http/Controllers/BasePageController.php b/app/Http/Controllers/BasePageController.php index 4eaff6f69..a3dee8523 100644 --- a/app/Http/Controllers/BasePageController.php +++ b/app/Http/Controllers/BasePageController.php @@ -80,7 +80,7 @@ class BasePageController extends Controller */ public function __construct() { - $this->middleware('auth')->except('api', 'rss', 'contact', 'showContactForm', 'callback'); + $this->middleware('auth')->except('api', 'rss', 'contact', 'showContactForm', 'callback', 'getNzb'); // Buffer settings/DB connection. $this->settings = new Settings(); $this->smarty = app('smarty.view'); diff --git a/app/Http/Controllers/GetNzbController.php b/app/Http/Controllers/GetNzbController.php index 3effaee61..afb73678a 100644 --- a/app/Http/Controllers/GetNzbController.php +++ b/app/Http/Controllers/GetNzbController.php @@ -129,7 +129,7 @@ class GetNzbController extends BasePageController $headers[] = [ 'Content-Disposition:' => 'attachment; filename='.$cleanName.'.nzb', 'Content-Type:' => 'application/x-nzb', - 'Expires:' => date('r', time() + 31536000), + 'Expires:' => date('r', Carbon::now()->addDays(365)->timestamp), 'X-DNZB-Failure:' => $this->serverurl.'failed'.'?guid='.$request->input('id').'&userid='.$uid.'&rsstoken='.$rssToken, 'X-DNZB-Category:' => $relData['category_name'], 'X-DNZB-Details:' => $this->serverurl.'details/'.$request->input('id'),