INNER CODE UNIT · Python

is_origin_allowed

SHAdd0WTAka/Zen-Ai-Pentest · api/main.py:536

def is_origin_allowed(origin: str) -> bool:
    """Prüft ob eine Origin erlaubt ist (inkl. Pattern-Matching)"""
    if not origin:
        return False
    if origin in ALL_ALLOWED_ORIGINS:
        return True
    if re.match(r"https://[a-z0-9-]+\.zen-alpha-pentest\.pages\.dev", origin):
        return True
    if re.match(r"https://[a-z-]+\.trycloudflare\.com", origin):
        return True
    return False


class DynamicCORSProcessor:
    """Middleware um CORS für dynamische Origins zu ermöglichen"""

    def __init__(self, app):
        self.app = app

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…