This commit is contained in:
Andras Bacsai 2023-05-26 14:05:58 +02:00
parent 97b336bff4
commit 820e432f92
4 changed files with 23 additions and 12 deletions

View File

@ -12,7 +12,7 @@ class TrustProxies extends Middleware
*
* @var array<int, string>|string|null
*/
protected $proxies;
protected $proxies = '*';
/**
* The headers that should be used to detect proxies.
@ -20,7 +20,7 @@ class TrustProxies extends Middleware
* @var int
*/
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |

View File

@ -24,15 +24,15 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
if ($this->app->environment('production')) {
try {
$settings = InstanceSettings::first();
if (Str::startsWith($settings->fqdn, 'https')) {
URL::forceScheme('https');
}
} catch (\Exception $e) {
// do nothing
}
}
// if ($this->app->environment('production')) {
// try {
// $settings = InstanceSettings::first();
// if (Str::startsWith($settings->fqdn, 'https')) {
// URL::forceScheme('https');
// }
// } catch (\Exception $e) {
// // do nothing
// }
// }
}
}

View File

@ -1,11 +1,16 @@
<?php
use App\Models\InstanceSettings;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Route;
use Visus\Cuid2\Cuid2;
use Illuminate\Support\Str;
function is_https()
{
return Str::of(InstanceSettings::get()->fqdn)->startsWith('https');
}
function general_error_handler(\Throwable $e, $that = null, $isJson = false)
{
try {

View File

@ -25,6 +25,11 @@
</head>
<body>
{{-- @if (is_https())
<script>
console.log('asd')
</script>
@else --}}
@livewireScripts
@auth
<x-navbar />
@ -60,6 +65,7 @@
})
</script>
@endauth
{{-- @endif --}}
</body>