jscheffl commented on code in PR #40901:
URL: https://github.com/apache/airflow/pull/40901#discussion_r1685531763


##########
airflow/api_internal/internal_api_call.py:
##########
@@ -75,10 +88,13 @@ def _init_values():
             raise RuntimeError("The AIP_44 is not enabled so you cannot use 
it.")
         internal_api_endpoint = ""
         if use_internal_api:
-            internal_api_url = conf.get("core", "internal_api_url")
-            internal_api_endpoint = internal_api_url + 
"/internal_api/v1/rpcapi"
-            if not internal_api_endpoint.startswith("http://";):
-                raise AirflowConfigException("[core]internal_api_url must 
start with http://";)
+            url_conf = urlparse(conf.get("core", "internal_api_url"))
+            api_path = url_conf.path
+            if len(api_path) < 2:
+                api_path = "/internal_api/v1/rpcapi"

Review Comment:
   Ah, okay - taht I can answer.
   If you give the `urlparse()` a `http://host:1234/` as input, the path will 
be `/` - if you provide `http://host:1234` then it is an empty string in 
`.path`. THat is why I checked... a valid length must be more than a single 
character.
   
   Do you have a better idea to say "if not empty string and not '/'"? Probalby 
all pat's below 10 chars is not a good realistic 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