Skip to content

Commit

Permalink
Allow forceHttps to be disabled, fixes pixelfed#3710
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup authored and yourivdlans committed Jul 7, 2023
1 parent 3c3aa3b commit 282c270
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions config/instance.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

return [
'force_https_urls' => env('FORCE_HTTPS_URLS', true),

'description' => env('INSTANCE_DESCRIPTION', 'Pixelfed - Photo sharing for everyone'),

Expand Down

0 comments on commit 282c270

Please sign in to comment.