File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -410,11 +410,17 @@ function jquery_default_site_options() {
410410 // prevent the redirect, but changes the redirect to the local site.
411411 //
412412 // WordPress/wp-login.php requires 'home' to use a full URL.
413- // If it uses a protocol-relative URL, it uses the entire URL as the path=
414- // and thus cause cookies to never be sent by the browser.
413+ // If it uses a protocol-relative URL, it uses the entire URL as the "path="
414+ // and thus cause cookies to never be sent by the browser. This doesn't matter
415+ // much for the public stage sites where we don't login, but it matters for
416+ // jquery-wp-docker.
417+ //
418+ // To ensure canonical URLs work correctly on public stage sites and avoid
419+ // HTTP-403 errors, apply set_url_scheme() which will change it to stay on
420+ // HTTPS if you're already on HTTPS.
415421 if ( JQUERY_STAGING ) {
416- $ defaults ['home ' ] = 'http:// ' . jquery_site_expand ( JQUERY_LIVE_SITE );
417- $ defaults ['siteurl ' ] = 'http:// ' . jquery_site_expand ( JQUERY_LIVE_SITE );
422+ $ defaults ['home ' ] = set_url_scheme ( 'http:// ' . jquery_site_expand ( JQUERY_LIVE_SITE ) );
423+ $ defaults ['siteurl ' ] = set_url_scheme ( 'http:// ' . jquery_site_expand ( JQUERY_LIVE_SITE ) );
418424 }
419425 return $ defaults ;
420426
You can’t perform that action at this time.
0 commit comments