Skip to content

Commit f28d236

Browse files
committed
fix: force $_SERVER['HTTPS'] when APP_URL uses HTTPS
Completes the fix for #290. Setting WP_HOME from config('app.url') was not sufficient — WordPress also checks $_SERVER['HTTPS'] for canonical URL redirects. Behind a reverse proxy, this variable is 'off' unless explicitly set, causing redirect loops. Instead of trusting proxy headers (removed in b98bfef for security), we derive the HTTPS state from the declarative APP_URL configuration.
1 parent a1b4a79 commit f28d236

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/WordPress/WordPressServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ private function handleHttpsProtocol(): void
8484
{
8585
if (is_secured()) {
8686
URL::forceScheme('https');
87+
$_SERVER['HTTPS'] = 'on';
8788
}
8889
}
8990
}

0 commit comments

Comments
 (0)