File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -502,27 +502,11 @@ function force_https(
502502 Services::session ()->regenerate (); // @codeCoverageIgnore
503503 }
504504
505- $ baseURL = config (App::class)->baseURL ;
506-
507- if (strpos ($ baseURL , 'https:// ' ) === 0 ) {
508- $ authority = substr ($ baseURL , strlen ('https:// ' ));
509- } elseif (strpos ($ baseURL , 'http:// ' ) === 0 ) {
510- $ authority = substr ($ baseURL , strlen ('http:// ' ));
511- } else {
512- $ authority = $ baseURL ;
513- }
514-
515- $ uri = URI ::createURIString (
516- 'https ' ,
517- $ authority ,
518- $ request ->getUri ()->getPath (), // Absolute URIs should use a "/" for an empty path
519- $ request ->getUri ()->getQuery (),
520- $ request ->getUri ()->getFragment ()
521- );
505+ $ uri = $ request ->getUri ()->withScheme ('https ' );
522506
523507 // Set an HSTS header
524508 $ response ->setHeader ('Strict-Transport-Security ' , 'max-age= ' . $ duration )
525- ->redirect ($ uri )
509+ ->redirect (( string ) $ uri )
526510 ->setStatusCode (307 )
527511 ->setBody ('' )
528512 ->getCookieStore ()
You can’t perform that action at this time.
0 commit comments