ashb commented on code in PR #53884:
URL: https://github.com/apache/airflow/pull/53884#discussion_r2304097022


##########
airflow-core/src/airflow/configuration.py:
##########
@@ -808,6 +809,19 @@ def _upgrade_postgres_metastore_conn(self):
             old_env_var = self._env_var_name("core", key)
             os.environ.pop(old_env_var, None)
 
+    def _strip_trailing_slash_from_base_url(self):
+        """Validate that api base_url config does not end with `/`."""
+        key = "base_url"
+        base_url = self.get("api", key, fallback="")
+        if base_url and base_url.endswith("/"):
+            self.upgraded_values[("api", key)] = base_url
+            new_base_url = base_url.rstrip("/")
+            self._update_env_var(section="api", name=key, 
new_value=new_base_url)
+        # if the old value is set via env var, we need to wipe it
+        # otherwise, it'll "win" over our adjusted value
+        old_env_var = self._env_var_name("core", key)

Review Comment:
   Why the core section? If the api section one is set that will always be used 
in preference to the core one.



##########
airflow-core/src/airflow/configuration.py:
##########
@@ -808,6 +809,19 @@ def _upgrade_postgres_metastore_conn(self):
             old_env_var = self._env_var_name("core", key)
             os.environ.pop(old_env_var, None)
 
+    def _strip_trailing_slash_from_base_url(self):

Review Comment:
   Why do we want to _strip_ it. Don't most places now need to ensure that it 
always exists? #54831 for example, and there were one or two more



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to