@@ -295,22 +295,20 @@ export async function workerFetch(request, env, ctx,home) {
295
295
296
296
if ( currentUrl . pathname . startsWith ( '/sysconf' ) ) {
297
297
let isAuth = true ;
298
- if ( CUSTOM_OPTIONS . Go_Proxy_BingAI_AUTH_KEY . length !== 0 ) {
299
- if ( CUSTOM_OPTIONS . Go_Proxy_BingAI_AUTH_KEY [ 0 ] != '' ) {
300
- const cookieStr = request . headers . get ( 'Cookie' ) || '' ;
301
- let cookieObjects = { } ;
302
- cookieStr . split ( ';' ) . forEach ( item => {
303
- if ( ! item ) {
304
- return ;
305
- }
306
- const arr = item . split ( '=' ) ;
307
- const key = arr [ 0 ] . trim ( ) ;
308
- const val = arr . slice ( 1 , arr . length + 1 ) . join ( '=' ) . trim ( ) ;
309
- cookieObjects [ key ] = val ;
310
- } )
311
- if ( cookieObjects [ AUTH_KEY_COOKIE_NAME ] !== CUSTOM_OPTIONS . Go_Proxy_BingAI_AUTH_KEY ) {
312
- isAuth = false ;
298
+ if ( CUSTOM_OPTIONS . Go_Proxy_BingAI_AUTH_KEY . length > 0 ) {
299
+ const cookieStr = request . headers . get ( 'Cookie' ) || '' ;
300
+ let cookieObjects = { } ;
301
+ cookieStr . split ( ';' ) . forEach ( item => {
302
+ if ( ! item ) {
303
+ return ;
313
304
}
305
+ const arr = item . split ( '=' ) ;
306
+ const key = arr [ 0 ] . trim ( ) ;
307
+ const val = arr . slice ( 1 , arr . length + 1 ) . join ( '=' ) . trim ( ) ;
308
+ cookieObjects [ key ] = val ;
309
+ } )
310
+ if ( cookieObjects [ AUTH_KEY_COOKIE_NAME ] !== CUSTOM_OPTIONS . Go_Proxy_BingAI_AUTH_KEY ) {
311
+ isAuth = false ;
314
312
}
315
313
}
316
314
return Response . json ( { code : 200 , message : 'success' , data : { isSysCK : false , isAuth : isAuth , info : CUSTOM_OPTIONS . INFO } } )
0 commit comments