Parcourir la source

Merge branch 'Kotenko' of gitgod/geolook into master

Serge il y a 5 ans
Parent
commit
a26f532f07

+ 1 - 0
app/Http/Kernel.php

@@ -19,6 +19,7 @@ class Kernel extends HttpKernel
         \App\Http\Middleware\TrimStrings::class,
         \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
         \App\Http\Middleware\TrustProxies::class,
+        \App\Http\Middleware\HttpsProtocol::class
     ];
 
     /**

+ 17 - 0
app/Http/Middleware/HttpsProtocol.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Closure;
+
+class HttpsProtocol {
+
+    public function handle($request, Closure $next)
+    {
+        if (@$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
+            \URL::forceScheme('https');
+        }
+
+        return $next($request);
+    }
+}

+ 6 - 6
app/Http/Middleware/VerifyCsrfToken.php

@@ -22,10 +22,10 @@ class VerifyCsrfToken extends Middleware
        // '869244226:'
     ];
 
-     public function __construct(\Illuminate\Foundation\Application $app, \Illuminate\Contracts\Encryption\Encrypter $encrypter)
-    {
-        $this->app = $app;
-        $this->encrypter = $encrypter;
-        $this->except[] = \Telegram::getAccessToken();
-    }
+//     public function __construct(\Illuminate\Foundation\Application $app, \Illuminate\Contracts\Encryption\Encrypter $encrypter)
+//    {
+//        $this->app = $app;
+//        $this->encrypter = $encrypter;
+//        $this->except[] = \Telegram::getAccessToken();
+//    }
 }

+ 1 - 1
app/Providers/AppServiceProvider.php

@@ -24,6 +24,6 @@ class AppServiceProvider extends ServiceProvider
      */
     public function boot()
     {
-        URL::forceScheme('https');
+//        URL::forceScheme('https');
     }
 }

+ 1 - 0
config/telegram.php

@@ -57,5 +57,6 @@ return [
     */
     'commands' => [
         Telegram\Bot\Commands\HelpCommand::class,
+        \App\TCommands\TestCommand::class,
     ],
 ];

+ 3 - 3
routes/web.php

@@ -27,6 +27,6 @@ Route::post('/tbot/'.Telegram::getAccessToken(), function(){
     Telegram::commandsHandler(true);
 });
 
-Route::post(Telegram::getAccessToken(), function () {
-	Telegram::commandsHandler(true);
-});
+//Route::post(Telegram::getAccessToken(), function () {
+//	Telegram::commandsHandler(true);
+//});