Add _APP_OPTIONS_FORCE_HTTPS to console vars

This commit is contained in:
Khushboo Verma
2024-11-20 16:12:35 +05:30
parent 338559967a
commit aa47d9f07a
4 changed files with 18 additions and 3 deletions
+2 -1
View File
@@ -51,7 +51,8 @@ App::get('/v1/console/variables')
'_APP_VCS_ENABLED' => $isVcsEnabled,
'_APP_DOMAIN_ENABLED' => $isDomainEnabled,
'_APP_ASSISTANT_ENABLED' => $isAssistantEnabled,
'_APP_DOMAIN_SITES' => System::getEnv('_APP_DOMAIN_SITES')
'_APP_DOMAIN_SITES' => System::getEnv('_APP_DOMAIN_SITES'),
'_APP_OPTIONS_FORCE_HTTPS' => System::getEnv('_APP_OPTIONS_FORCE_HTTPS')
]);
$response->dynamic($variables, Response::MODEL_CONSOLE_VARIABLES);
+4
View File
@@ -96,6 +96,10 @@
"config": {
"platform": {
"php": "8.3"
},
"allow-plugins": {
"php-http/discovery": true,
"tbachert/spi": true
}
}
}
@@ -57,7 +57,16 @@ class ConsoleVariables extends Model
'description' => 'A domain to use for site URLs.',
'default' => '',
'example' => 'sites.localhost',
]);
])
->addRule(
'_APP_OPTIONS_FORCE_HTTPS',
[
'type' => self::TYPE_STRING,
'description' => 'Defines if HTTPS is enforced for all requests.',
'default' => '',
'example' => 'enabled',
]
);
}
/**
@@ -24,7 +24,7 @@ class ConsoleConsoleClientTest extends Scope
], $this->getHeaders()));
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertCount(8, $response['body']);
$this->assertCount(9, $response['body']);
$this->assertIsString($response['body']['_APP_DOMAIN_TARGET']);
$this->assertIsInt($response['body']['_APP_STORAGE_LIMIT']);
$this->assertIsInt($response['body']['_APP_COMPUTE_SIZE_LIMIT']);
@@ -33,5 +33,6 @@ class ConsoleConsoleClientTest extends Scope
$this->assertIsBool($response['body']['_APP_VCS_ENABLED']);
$this->assertIsBool($response['body']['_APP_ASSISTANT_ENABLED']);
$this->assertIsString($response['body']['_APP_DOMAIN_SITES']);
$this->assertIsString($response['body']['_APP_OPTIONS_FORCE_HTTPS']);
}
}