File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ class PreventRegularBrowserAccess
9
9
{
10
10
public function handle (Request $ request , Closure $ next )
11
11
{
12
+ if (! config ('nativephp-internal.running ' )) {
13
+ return $ next ($ request );
14
+ }
15
+
12
16
// Explicitly skip for the cookie-setting route
13
17
if ($ request ->path () === '_native/api/cookie ' ) {
14
18
return $ next ($ request );
Original file line number Diff line number Diff line change 4
4
5
5
use Illuminate \Console \Application ;
6
6
use Illuminate \Foundation \Application as Foundation ;
7
+ use Illuminate \Foundation \Http \Kernel ;
7
8
use Illuminate \Support \Arr ;
8
9
use Illuminate \Support \Facades \Artisan ;
9
10
use Illuminate \Support \Facades \DB ;
23
24
use Native \Laravel \Events \EventWatcher ;
24
25
use Native \Laravel \Exceptions \Handler ;
25
26
use Native \Laravel \GlobalShortcut as GlobalShortcutImplementation ;
27
+ use Native \Laravel \Http \Middleware \PreventRegularBrowserAccess ;
26
28
use Native \Laravel \Logging \LogWatcher ;
27
29
use Native \Laravel \PowerMonitor as PowerMonitorImplementation ;
28
30
use Native \Laravel \Windows \WindowManager as WindowManagerImplementation ;
@@ -84,6 +86,11 @@ public function packageRegistered()
84
86
Handler::class
85
87
);
86
88
89
+ // Automatically prevent browser access
90
+ $ this ->app ->make (Kernel::class)->pushMiddleware (
91
+ PreventRegularBrowserAccess::class,
92
+ );
93
+
87
94
Application::starting (function ($ app ) {
88
95
$ app ->resolveCommands ([
89
96
LoadStartupConfigurationCommand::class,
You can’t perform that action at this time.
0 commit comments