Fix: Allow HTTP for local Supabase connections (#323)
- Modified validate_supabase_url() to allow HTTP for local development - HTTP is now allowed for localhost, 127.0.0.1, host.docker.internal, and 0.0.0.0 - HTTPS is still required for production/non-local environments - Fixes server startup failure when using local Supabase with Docker
This commit is contained in:
parent
b5e5cddc68
commit
913cdcd349
@ -97,8 +97,15 @@ def validate_supabase_url(url: str) -> bool:
|
||||
raise ConfigurationError("Supabase URL cannot be empty")
|
||||
|
||||
parsed = urlparse(url)
|
||||
if parsed.scheme != "https":
|
||||
raise ConfigurationError("Supabase URL must use HTTPS")
|
||||
# Allow HTTP for local development (host.docker.internal or localhost)
|
||||
if parsed.scheme not in ("http", "https"):
|
||||
raise ConfigurationError("Supabase URL must use HTTP or HTTPS")
|
||||
|
||||
# Require HTTPS for production (non-local) URLs
|
||||
if parsed.scheme == "http":
|
||||
hostname = parsed.hostname or ""
|
||||
if not any(local in hostname for local in ["localhost", "127.0.0.1", "host.docker.internal", "0.0.0.0"]):
|
||||
raise ConfigurationError("Supabase URL must use HTTPS for non-local environments")
|
||||
|
||||
if not parsed.netloc:
|
||||
raise ConfigurationError("Invalid Supabase URL format")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user