Skip to content

Commit

Permalink
Add CANONICAL_DOMAIN variable and derive CANONICAL_ORIGIN from it
Browse files Browse the repository at this point in the history
  • Loading branch information
krysal committed Feb 26, 2024
1 parent ad6b3da commit c4c7f39
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion catalog/dags/common/loader/provider_details.py
Expand Up @@ -124,7 +124,12 @@

# 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", "openverse.org")

_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})"


Expand Down

0 comments on commit c4c7f39

Please sign in to comment.