diff --git a/catalog/dags/common/loader/provider_details.py b/catalog/dags/common/loader/provider_details.py index 08b805bfb5e..ad04d75f1c0 100644 --- a/catalog/dags/common/loader/provider_details.py +++ b/catalog/dags/common/loader/provider_details.py @@ -124,7 +124,14 @@ # User-Agent header for APIs that require it CONTACT_EMAIL = os.getenv("CONTACT_EMAIL") -CANONICAL_ORIGIN = os.getenv("CANONICAL_ORIGIN", "https://openverse.org") + +CANONICAL_DOMAIN: str = os.getenv( + "CANONICAL_DOMAIN", "https://openverse.org" +) # required + +_proto = "http" if "localhost" in CANONICAL_DOMAIN else "https" +CANONICAL_ORIGIN: str = f"{_proto}://{CANONICAL_DOMAIN}" + UA_STRING = f"Openverse/0.1 ({CANONICAL_ORIGIN}; {CONTACT_EMAIL})"