File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ class PreventRegularBrowserAccess
99{
1010 public function handle (Request $ request , Closure $ next )
1111 {
12+ if (! config ('nativephp-internal.running ' )) {
13+ return $ next ($ request );
14+ }
15+
1216 // Explicitly skip for the cookie-setting route
1317 if ($ request ->path () === '_native/api/cookie ' ) {
1418 return $ next ($ request );
Original file line number Diff line number Diff line change 44
55use Illuminate \Console \Application ;
66use Illuminate \Foundation \Application as Foundation ;
7+ use Illuminate \Foundation \Http \Kernel ;
78use Illuminate \Support \Arr ;
89use Illuminate \Support \Facades \Artisan ;
910use Illuminate \Support \Facades \DB ;
2324use Native \Laravel \Events \EventWatcher ;
2425use Native \Laravel \Exceptions \Handler ;
2526use Native \Laravel \GlobalShortcut as GlobalShortcutImplementation ;
27+ use Native \Laravel \Http \Middleware \PreventRegularBrowserAccess ;
2628use Native \Laravel \Logging \LogWatcher ;
2729use Native \Laravel \PowerMonitor as PowerMonitorImplementation ;
2830use Native \Laravel \Windows \WindowManager as WindowManagerImplementation ;
@@ -84,6 +86,11 @@ public function packageRegistered()
8486 Handler::class
8587 );
8688
89+ // Automatically prevent browser access
90+ $ this ->app ->make (Kernel::class)->pushMiddleware (
91+ PreventRegularBrowserAccess::class,
92+ );
93+
8794 Application::starting (function ($ app ) {
8895 $ app ->resolveCommands ([
8996 LoadStartupConfigurationCommand::class,
You can’t perform that action at this time.
0 commit comments