Take redirects off the Host header.

Same-site redirects are now relative paths, and a saved page on another site is ignored. The HTTP to HTTPS redirect takes its host from the new SITE_URL setting, and without it the pages refuse plain HTTP.
This commit is contained in:
tim
2026-09-26 15:27:51 +02:00
parent 4657088d23
commit be814a3ba5
16 changed files with 149 additions and 73 deletions
+6 -1
View File
@@ -15,6 +15,11 @@ abstract class PageTestCase extends \PHPUnit\Framework\TestCase {
protected static string $base;
private static $server = NULL;
// Environment variables for the server, on top of the usual ones
protected static function serverEnv(): array {
return array();
}
// The cookies that the site set, name => value
protected array $cookies = array();
@@ -43,7 +48,7 @@ abstract class PageTestCase extends \PHPUnit\Framework\TestCase {
'XXX_TEST_LOG' => self::$state . '/php.log',
'MAIL_LOG' => self::$state . '/mail.jsonl',
'UPLOAD_DIR' => self::$state . '/tmp/uploads',
);
) + static::serverEnv();
$log = array('file', self::$state . '/server.log', 'a');
self::$server = proc_open($command, array(0 => array('file', '/dev/null', 'r'), 1 => $log, 2 => $log), $pipes, XXX_ROOT, $env);