Explorar el Código

Fallback url generation to the secured scheme in blade views

Bubka hace 5 meses
padre
commit
c477d879e8

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

@@ -5,7 +5,7 @@
         <meta name="viewport" content="width=device-width, initial-scale=1">
         <meta name="viewport" content="width=device-width, initial-scale=1">
         <title>{{ config('app.name', 'Laravel') }}</title>
         <title>{{ config('app.name', 'Laravel') }}</title>
         <!-- Styles -->
         <!-- Styles -->
-        <link rel="stylesheet" href="{{ url('healthcheck.css', [], $isSecure) }}"></link>
+        <link rel="stylesheet" href="{{ url('healthcheck.css', [], $isSecure ?? true) }}"></link>
     </head>
     </head>
     <body class="antialiased">
     <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">
         <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="icon" type="image/png" href="{{ asset('favicon.png') }}" />
     <link rel="apple-touch-icon" href="{{ asset('favicon_lg.png') }}" />
     <link rel="apple-touch-icon" href="{{ asset('favicon_lg.png') }}" />
     <link rel="apple-touch-icon-precomposed" href="{{ asset('favicon_lg.png') }}" />
     <link rel="apple-touch-icon-precomposed" href="{{ asset('favicon_lg.png') }}" />
-    <link rel="manifest" href="{{ url('manifest.json', [], $isSecure) }}">
+    <link rel="manifest" href="{{ url('manifest.json', [], $isSecure ?? true) }}">
 
 
 </head>
 </head>
 <body>
 <body>

+ 3 - 0
tests/Feature/ViewTest.php

@@ -40,12 +40,15 @@ class ViewTest extends FeatureTestCase
 
 
         $response->assertViewHas('appSettings');
         $response->assertViewHas('appSettings');
         $response->assertViewHas('appConfig');
         $response->assertViewHas('appConfig');
+        $response->assertViewHas('urls');
         $response->assertViewHas('defaultPreferences');
         $response->assertViewHas('defaultPreferences');
         $response->assertViewHas('subdirectory');
         $response->assertViewHas('subdirectory');
         $response->assertViewHas('isDemoApp');
         $response->assertViewHas('isDemoApp');
         $response->assertViewHas('isTestingApp');
         $response->assertViewHas('isTestingApp');
         $response->assertViewHas('lang');
         $response->assertViewHas('lang');
         $response->assertViewHas('locales');
         $response->assertViewHas('locales');
+        $response->assertViewHas('cspNonce');
+        $response->assertViewHas('isSecure');
     }
     }
 
 
     #[Test]
     #[Test]