From e2a092ea0436f9f9805e0633b0addef5f10e6f35 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 12:50:17 +1000 Subject: [PATCH] Remove trailing slash from SITE_URL (#9559) (#9560) - ref: https://github.com/inventree/InvenTree/discussions/9552 - ref: https://stackoverflow.com/questions/56404930/when-trying-set-corsheaders-in-settings-py-file (cherry picked from commit 527652007e934bc05476859ab3ec4fbdffb313db) Co-authored-by: Oliver --- src/backend/InvenTree/InvenTree/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend/InvenTree/InvenTree/settings.py b/src/backend/InvenTree/InvenTree/settings.py index c7745bb828..ced4eb3e14 100644 --- a/src/backend/InvenTree/InvenTree/settings.py +++ b/src/backend/InvenTree/InvenTree/settings.py @@ -1095,6 +1095,7 @@ IMPORT_EXPORT_USE_TRANSACTIONS = True SITE_URL = get_setting('INVENTREE_SITE_URL', 'site_url', None) if SITE_URL: + SITE_URL = str(SITE_URL).strip().rstrip('/') logger.info('Using Site URL: %s', SITE_URL) # Check that the site URL is valid