File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
resources/js/electron-plugin/src Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
import type CrossProcessExports from "electron" ;
2
- import { app } from "electron" ;
3
- import { initialize } from "@electron/remote/main/index.js" ;
2
+ import { app , session } from "electron" ;
3
+ import { initialize } from "@electron/remote/main/index.js" ;
4
4
import state from "./server/state.js" ;
5
5
import { electronApp , optimizer } from "@electron-toolkit/utils" ;
6
6
import {
@@ -107,6 +107,16 @@ class NativePHP {
107
107
await this . startPhpApp ( ) ;
108
108
this . startScheduler ( ) ;
109
109
110
+ const filter = {
111
+ urls : [ `http://127.0.0.1:${ state . phpPort } /*` ]
112
+ } ;
113
+
114
+ session . defaultSession . webRequest . onBeforeSendHeaders ( filter , ( details , callback ) => {
115
+ details . requestHeaders [ 'X-NativePHP-Secret' ] = state . randomSecret ;
116
+
117
+ callback ( { requestHeaders : details . requestHeaders } ) ;
118
+ } ) ;
119
+
110
120
await notifyLaravel ( "booted" ) ;
111
121
}
112
122
You can’t perform that action at this time.
0 commit comments