File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -502,27 +502,11 @@ function force_https(
502
502
Services::session ()->regenerate (); // @codeCoverageIgnore
503
503
}
504
504
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 ' );
522
506
523
507
// Set an HSTS header
524
508
$ response ->setHeader ('Strict-Transport-Security ' , 'max-age= ' . $ duration )
525
- ->redirect ($ uri )
509
+ ->redirect (( string ) $ uri )
526
510
->setStatusCode (307 )
527
511
->setBody ('' )
528
512
->getCookieStore ()
You can’t perform that action at this time.
0 commit comments