Browse Source

Merge pull request #3710 from thisislawatts/fix/opt-out-of-forcing-https

fix: add opt of forceScheme(https)
daniel 2 năm trước cách đây
mục cha
commit
f776c79284
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      app/Providers/AppServiceProvider.php

+ 3 - 1
app/Providers/AppServiceProvider.php

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