런처 API 교차 출처 세션 확인 허용

This commit is contained in:
seo committed 2026-07-28 22:57:37 +09:00
1 parent 59f9231648
commit b22dfd5632
1 file changed
+14
+14
View File
@@ -6,6 +6,20 @@ require_once __DIR__ . '/../common/ha.php';
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: application/json; charset=utf-8');
header('Cache-Control: no-store'); header('Cache-Control: no-store');
$origin = (string)($_SERVER['HTTP_ORIGIN'] ?? '');
if (preg_match('#^https://([a-z0-9-]+\.)?chaegeon\.com$#i', $origin) === 1) {
header('Access-Control-Allow-Origin: ' . $origin);
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Headers: Content-Type, X-Requested-With');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Vary: Origin');
}
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(204);
exit;
}
$config = custom_config(); $config = custom_config();
function launcher_is_digit_password(string $password): bool function launcher_is_digit_password(string $password): bool