From 9d37eaa57b2854ac7887b1ed668408a6bacfbeef Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 5 Sep 2023 17:28:13 +0200 Subject: [PATCH] Fix - Link in the RSS feed was showing the path twice (when used in reverse proxy) --- changedetectionio/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 7f982c8d1..55a69c62d 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -355,11 +355,13 @@ def changedetection_app(config=None, datastore_o=None): # Include a link to the diff page, they will have to login here to see if password protection is enabled. # Description is the page you watch, link takes you to the diff JS UI page - base_url = datastore.data['settings']['application']['base_url'] - if base_url == '': - base_url = "" - - diff_link = {'href': "{}{}".format(base_url, url_for('diff_history_page', uuid=watch['uuid']))} + # Dict val base_url will get overriden with the env var if it is set. + ext_base_url = datastore.data['settings']['application'].get('base_url') + if ext_base_url: + # Go with overriden value + diff_link = {'href': "{}{}".format(ext_base_url, url_for('diff_history_page', uuid=watch['uuid'], _external=False))} + else: + diff_link = {'href': url_for('diff_history_page', uuid=watch['uuid'], _external=True)} fe.link(link=diff_link)