Browse Source

Fix manifest & healthcheck css paths (again)

Bubka 8 months ago
parent
commit
c38f3cfef7

+ 2 - 0
app/Http/Controllers/SinglePageController.php

@@ -34,6 +34,7 @@ class SinglePageController extends Controller
         $ssoDocUrl          = config('2fauth.ssoDocUrl');
         $exportSchemaUrl    = config('2fauth.exportSchemaUrl');
         $cspNonce           = Vite::cspNonce();
+        $isSecure           = str_starts_with(config('app.url'), 'https');
 
         // if (Auth::user()->preferences)
 
@@ -60,6 +61,7 @@ class SinglePageController extends Controller
             'lang'               => $lang,
             'locales'            => $locales,
             'cspNonce'           => $cspNonce,
+            'isSecure'           => $isSecure,
         ]);
     }
 }

+ 1 - 1
resources/views/health.blade.php

@@ -5,7 +5,7 @@
         <meta name="viewport" content="width=device-width, initial-scale=1">
         <title>{{ config('app.name', 'Laravel') }}</title>
         <!-- Styles -->
-        <link rel="stylesheet" href="{{ url('healthcheck.css') }}"></link>
+        <link rel="stylesheet" href="{{ url('healthcheck.css', [], $isSecure) }}"></link>
     </head>
     <body class="antialiased">
         <div class="relative sm:flex sm:justify-center sm:items-center min-h-screen bg-gray-100 selection:bg-red-500 selection:text-white">

+ 1 - 1
resources/views/landing.blade.php

@@ -15,7 +15,7 @@
     <link rel="icon" type="image/png" href="{{ asset('favicon.png') }}" />
     <link rel="apple-touch-icon" href="{{ asset('favicon_lg.png') }}" />
     <link rel="apple-touch-icon-precomposed" href="{{ asset('favicon_lg.png') }}" />
-    <link rel="manifest" href="{{ url('manifest.json') }}">
+    <link rel="manifest" href="{{ url('manifest.json', [], $isSecure) }}">
 
 </head>
 <body>

+ 3 - 1
routes/web.php

@@ -106,7 +106,9 @@ Route::withoutMiddleware([
     CustomCreateFreshApiToken::class,
 ])->get('/up', function () {
     //Event::dispatch(new DiagnosingHealth);
-    return view('health');
+    return view('health', [
+        'isSecure' => str_starts_with(config('app.url'), 'https'),
+    ]);
 });
 
 // Route::get('/notification', function () {