Pārlūkot izejas kodu

Allow forceHttps to be disabled, fixes #3710

Daniel Supernault 2 gadi atpakaļ
vecāks
revīzija
a31bdec750
2 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 2 1
      app/Providers/AppServiceProvider.php
  2. 1 0
      config/instance.php

+ 2 - 1
app/Providers/AppServiceProvider.php

@@ -40,9 +40,10 @@ class AppServiceProvider extends ServiceProvider
 	 */
 	public function boot()
 	{
-		if (preg_match("/^https/", env('APP_URL')) || env('APP_ENV') === 'production') {
+		if(config('instance.force_https_urls')) {
 			URL::forceScheme('https');
 		}
+
 		Schema::defaultStringLength(191);
 		Paginator::useBootstrap();
 		Avatar::observe(AvatarObserver::class);

+ 1 - 0
config/instance.php

@@ -1,6 +1,7 @@
 <?php
 
 return [
+	'force_https_urls' => env('FORCE_HTTPS_URLS', true),
 
 	'description' => env('INSTANCE_DESCRIPTION', 'Pixelfed - Photo sharing for everyone'),