Phase 3.1: Enhanced Chore Logging and Reporting System
This commit is contained in:
37
backend/check_cors.py
Normal file
37
backend/check_cors.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""Check what CORS configuration the backend is actually using."""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Add parent directory to path
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
|
||||
from app.core.config import settings
|
||||
|
||||
print("="*70)
|
||||
print("BACKEND CORS CONFIGURATION CHECK")
|
||||
print("="*70)
|
||||
print()
|
||||
|
||||
print(f"ALLOWED_ORIGINS (raw): {settings.ALLOWED_ORIGINS}")
|
||||
print(f"Type: {type(settings.ALLOWED_ORIGINS)}")
|
||||
print()
|
||||
|
||||
print(f"cors_origins (parsed): {settings.cors_origins}")
|
||||
print(f"Type: {type(settings.cors_origins)}")
|
||||
print()
|
||||
|
||||
print("Individual origins:")
|
||||
for i, origin in enumerate(settings.cors_origins, 1):
|
||||
print(f" {i}. '{origin}' (length: {len(origin)})")
|
||||
print()
|
||||
|
||||
print("="*70)
|
||||
print()
|
||||
|
||||
# Check if the frontend URL is in there
|
||||
frontend_url = "http://localhost:5173"
|
||||
if frontend_url in settings.cors_origins:
|
||||
print(f"✅ Frontend URL '{frontend_url}' IS in allowed origins")
|
||||
else:
|
||||
print(f"❌ Frontend URL '{frontend_url}' NOT in allowed origins")
|
||||
print(f" Closest match: {[o for o in settings.cors_origins if '5173' in o]}")
|
||||
Reference in New Issue
Block a user