Skip to content

Commit

Permalink
Strip slashes from env var URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Jan 5, 2024
1 parent a103371 commit 7769e7a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def get_wagtail_media(media_id):
get_wagtail_image=get_wagtail_image,
get_wagtail_page=get_wagtail_page,
get_wagtail_media=get_wagtail_media,
# WAGTAIL_MEDIA_URL=Config().WAGTAIL_MEDIA_URL.strip("/"),
WAGTAIL_MEDIA_URL=Config().WAGTAIL_MEDIA_URL,
)

Expand Down
1 change: 0 additions & 1 deletion app/wagtail/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def wagtail_request_handler(uri, params={}):
if not api_url:
current_app.logger.critical("WAGTAIL_API_URL not set")
raise Exception("WAGTAIL_API_URL not set")
api_url = api_url.strip("/")
params["format"] = "json"
query_string = (
"?"
Expand Down
6 changes: 3 additions & 3 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class Config(object):
ENVIRONMENT = os.environ.get("ENVIRONMENT", "production")
SECRET_KEY = os.environ.get("SECRET_KEY")
DEBUG = strtobool(os.getenv("DEBUG", "False"))
WAGTAIL_API_URL = os.environ.get("WAGTAIL_API_URL")
WAGTAIL_MEDIA_URL = os.environ.get("WAGTAIL_MEDIA_URL")
SEARCH_API_URL = os.environ.get("SEARCH_API_URL")
WAGTAIL_API_URL = os.environ.get("WAGTAIL_API_URL").rstrip("/")
WAGTAIL_MEDIA_URL = os.environ.get("WAGTAIL_MEDIA_URL").rstrip("/")
SEARCH_API_URL = os.environ.get("SEARCH_API_URL").rstrip("/")


cache_config = {
Expand Down

0 comments on commit 7769e7a

Please sign in to comment.