diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index 599808331..42dab2a66 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -32,10 +32,13 @@ x-bind:class="{ 'dark': isDark === true }" >
- + {{-- Skipped locally so the site can be served over plain http --}} + @unless (app()->isLocal()) + + @endunless - + {{-- Skipped locally so the site can be served over plain http --}} + @unless (app()->isLocal()) + + @endunless diff --git a/resources/views/components/layouts/dashboard.blade.php b/resources/views/components/layouts/dashboard.blade.php index ae2f5548b..54dd23668 100644 --- a/resources/views/components/layouts/dashboard.blade.php +++ b/resources/views/components/layouts/dashboard.blade.php @@ -32,10 +32,13 @@ x-bind:class="{ 'dark': isDark === true }" > - + {{-- Skipped locally so the site can be served over plain http --}} + @unless (app()->isLocal()) + + @endunless ['/docs/mobile/3/getting-started/introduction', false], + 'auth layout' => ['/login', false], + 'dashboard layout' => ['/dashboard', true], + ]; + } + + #[Test] + #[DataProvider('pages')] + public function pages_upgrade_insecure_requests_outside_local(string $uri, bool $signedIn): void + { + $this->app['env'] = 'production'; + + $this->getPage($uri, $signedIn) + ->assertStatus(200) + ->assertSee('content="upgrade-insecure-requests"', false); + } + + #[Test] + #[DataProvider('pages')] + public function pages_do_not_upgrade_insecure_requests_locally(string $uri, bool $signedIn): void + { + $this->app['env'] = 'local'; + + $this->getPage($uri, $signedIn) + ->assertStatus(200) + ->assertDontSee('upgrade-insecure-requests', false); + } + + private function getPage(string $uri, bool $signedIn) + { + if ($signedIn) { + $this->actingAs(User::factory()->create()); + } + + return $this->withoutVite()->get($uri); + } +}