From c965f693ba7cdc5cd9d45982ccf1ce4d60e4e368 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 12:45:53 +0000 Subject: [PATCH] fix(deploy): Exclude port from URL on Render.com The application was generating URLs that included the internal port number (e.g., `:8080`) when deployed on Render.com. This caused Render's Web Application Firewall (WAF) to block requests with a 403 Forbidden error. This commit modifies the URL generation logic in `FileStream/config.py` to conditionally exclude the port from the URL if the `FQDN` indicates a Render.com deployment. This ensures that the generated download links are correctly formatted for the Render environment, resolving the WAF issue. --- FileStream/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FileStream/config.py b/FileStream/config.py index 48c49c81..39aee81b 100644 --- a/FileStream/config.py +++ b/FileStream/config.py @@ -34,7 +34,7 @@ class Server: NO_PORT = str(env.get("NO_PORT", "0").lower()) in ("1", "true", "t", "yes", "y") FQDN = str(env.get("FQDN", BIND_ADDRESS)) URL = "http{}://{}{}/".format( - "s" if HAS_SSL else "", FQDN, "" if NO_PORT else ":" + str(PORT) + "s" if HAS_SSL else "", FQDN, "" if NO_PORT or ".onrender.com" in FQDN else ":" + str(PORT) )