@@ -488,7 +488,8 @@ export async function runCLI(args: RunCLIArgs): Promise<RunCLIServer> {
488
488
const fileLockManager = new FileLockManagerForNode ( nativeFlockSync ) ;
489
489
490
490
let wordPressReady = false ;
491
- let isFirstRequest = false ; // Set to true after booting WordPress
491
+ let isFirstRequest = true ;
492
+ let isSecondRequest = false ;
492
493
493
494
logger . log ( 'Starting a PHP server...' ) ;
494
495
@@ -625,7 +626,6 @@ export async function runCLI(args: RunCLIArgs): Promise<RunCLIServer> {
625
626
626
627
await playground . isReady ( ) ;
627
628
wordPressReady = true ;
628
- isFirstRequest = true ;
629
629
logger . log ( `Booted!` ) ;
630
630
631
631
if ( compiledBlueprint ) {
@@ -753,10 +753,11 @@ export async function runCLI(args: RunCLIArgs): Promise<RunCLIServer> {
753
753
// assume they don't have to auto-login again.
754
754
if ( isFirstRequest ) {
755
755
isFirstRequest = false ;
756
+ isSecondRequest = true ;
756
757
const headers : Record < string , string [ ] > = {
757
758
'Content-Type' : [ 'text/plain' ] ,
758
759
'Content-Length' : [ '0' ] ,
759
- Location : [ compiledBlueprint . landingPage ] ,
760
+ Location : [ '/' ] ,
760
761
} ;
761
762
if (
762
763
request . headers ?. [ 'cookie' ] ?. includes (
@@ -767,14 +768,7 @@ export async function runCLI(args: RunCLIArgs): Promise<RunCLIServer> {
767
768
'playground_auto_login_already_happened=1; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/' ,
768
769
] ;
769
770
}
770
- return new PHPResponse (
771
- 302 ,
772
- {
773
- 'Content-Length' : [ '0' ] ,
774
- Location : [ compiledBlueprint . landingPage ] ,
775
- } ,
776
- new Uint8Array ( )
777
- ) ;
771
+ return new PHPResponse ( 302 , headers , new Uint8Array ( ) ) ;
778
772
}
779
773
return await loadBalancer . handleRequest ( request ) ;
780
774
} ,
0 commit comments