GeoLeaf Core API - v3.19.0
    Preparing search index...

    Class SecurityError

    A security rule was violated — XSS-shaped content, a disallowed URL protocol, a non-image data URL.

    Code: SECURITY_ERROR. Worth catching separately from ValidationError: this one marks input that was actively rejected, not merely malformed, and is usually worth logging.

    throw new GeoLeaf.Errors.SecurityError("Protocol not allowed: javascript:", {
    url: "javascript:alert(1)",
    allowedProtocols: ["http:", "https:", "data:"],
    });

    try {
    GeoLeaf.Validators.validateUrl(userUrl, { throwOnError: true });
    } catch (error) {
    if (error instanceof GeoLeaf.Errors.SecurityError) {
    console.error("Tentative de sécurité détectée");
    // Logger pour analyse
    }
    }

    Hierarchy (View Summary)

    Index
    context: ErrorContext
    timestamp: string
    code: string