From 876db70bca2ae18571a1370f5507d56f99129e8d Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 5 Aug 2025 12:24:25 +0200 Subject: [PATCH] wait #7673 @0.5 --- src/app/Middleware/StartSession.php | 21 +++++++++++++++++++++ src/routes/cubist/backpack/cdnproxy.php | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/app/Middleware/StartSession.php diff --git a/src/app/Middleware/StartSession.php b/src/app/Middleware/StartSession.php new file mode 100644 index 0000000..4ac94e6 --- /dev/null +++ b/src/app/Middleware/StartSession.php @@ -0,0 +1,21 @@ +isMethod('GET') && + $request->route() instanceof Route && + !in_array($request->route()->getName(), ['cdnproxy']) && + !$request->ajax() && + !$request->prefetch() && + !$request->isPrecognitive()) { + $session->setPreviousUrl($request->fullUrl()); + } + } +} diff --git a/src/routes/cubist/backpack/cdnproxy.php b/src/routes/cubist/backpack/cdnproxy.php index 1fc8154..2023778 100644 --- a/src/routes/cubist/backpack/cdnproxy.php +++ b/src/routes/cubist/backpack/cdnproxy.php @@ -26,5 +26,5 @@ Route::group([ copy($url, $cache); } return \Cubist\Backpack\Http\Controllers\Base\XSendFileController::sendfile($cache); - })->where(['url' => '.*']); + })->where(['url' => '.*'])->name('cdnproxy'); }); -- 2.39.5