pankajkoti commented on code in PR #31833:
URL: https://github.com/apache/airflow/pull/31833#discussion_r1280424713


##########
airflow/www/extensions/init_wsgi_middlewares.py:
##########
@@ -37,8 +38,11 @@ def _root_app(env: WSGIEnvironment, resp: StartResponse) -> 
Iterable[bytes]:
 
 def init_wsgi_middleware(flask_app: Flask) -> None:
     """Handle X-Forwarded-* headers and base_url support."""
+    webserver_base_url = conf.get_mandatory_value("webserver", "BASE_URL", 
fallback="")
+    if webserver_base_url.endswith("/"):
+        raise AirflowConfigException("webserver.base_url conf cannot have a 
trailing slash.")

Review Comment:
   okay, I am coming from 
[here](https://github.com/apache/airflow/issues/32996#issuecomment-1659952828) 
on how the python `urllib.parse.urljoin` handles joining base URL and relative 
URLs.
   
   Wouldn't `https://my.astronomer.run/path` qualify as a valid base URL? But 
looks like the `urljoin` just ignores the path when it does not end with a 
trailing `/`. If it was `https://my.astronomer.run/path/` `urljoin` does not 
strip the path



-- 
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