feat: Tambah script test_cors.php untuk debug CORS middleware

This commit is contained in:
mwpn
2025-12-17 14:07:45 +07:00
parent bae1da324b
commit e59bf9d981
2 changed files with 133 additions and 3 deletions

View File

@@ -33,14 +33,29 @@ CORS_ALLOWED_ORIGINS=https://app.example.com,https://dashboard.example.com
```
```bash
# 5. Restart PHP-FPM (via aaPanel atau command)
# 5. Restart PHP-FPM (PENTING! Harus di-restart setelah perubahan code)
# Via aaPanel: Website -> PHP -> Service Management -> Reload
# Atau:
systemctl reload php-fpm-83 # Sesuaikan dengan PHP version
# Atau via command (sesuaikan dengan PHP version):
systemctl reload php-fpm-83 # Untuk PHP 8.3
# systemctl reload php-fpm-82 # Untuk PHP 8.2
# 6. (Opsional) Clear PHP Opcache jika masih ada masalah
# Via aaPanel: Website -> PHP -> Opcache -> Clear Cache
# Atau via command:
php -r "opcache_reset();"
```
## ✅ Verifikasi CORS Aktif
### Test 0: Test CORS Middleware Secara Langsung (Recommended)
```bash
# Jalankan script test di server
php bin/test_cors.php
```
Script ini akan test CORS middleware secara langsung dan menunjukkan apakah headers sudah muncul.
### Test 1: Cek Response Headers
```bash