1
0
mirror of https://github.com/Kovah/LinkAce.git synced 2025-01-29 10:59:49 +01:00

Add option to enforce HTTPS usage behind proxies

This commit is contained in:
Kovah 2019-07-02 13:36:25 +02:00
parent 6493cf8806
commit 6b2d4734d5
No known key found for this signature in database
GPG Key ID: AAAA031BA9830D7B
3 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,8 @@ APP_ENV=local
APP_KEY=
# Enable the debug more if you are running into issues or while developing
APP_DEBUG=true
# Set to true, if you are using a proxy that terminates SSL. Required to get the correct URLs for LinkAce
FORCE_HTTPS=false
## Configuration of the database connection
# Set the database driver (mysql, )

View File

@ -12,7 +12,7 @@ class TrustProxies extends Middleware
*
* @var array
*/
protected $proxies;
protected $proxies = '**';
/**
* The headers that should be used to detect proxies.

View File

@ -3,6 +3,7 @@
namespace App\Providers;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@ -15,6 +16,10 @@ class AppServiceProvider extends ServiceProvider
public function boot()
{
Schema::defaultStringLength(191);
if (env('FORCE_HTTPS', false)) {
URL::forceSchema('https');
}
}
/**