jroachgolf84 commented on code in PR #71665:
URL: https://github.com/apache/airflow/pull/71665#discussion_r3791700342
##########
providers/http/tests/unit/http/hooks/test_http.py:
##########
@@ -599,6 +599,12 @@ def test_keep_alive_disabled(self):
[
pytest.param("https://example.org", "/v1/test",
"https://example.org/v1/test", id="both-set"),
pytest.param("", "http://foo/bar/v1/test",
"http://foo/bar/v1/test", id="only-endpoint"),
+ pytest.param(
Review Comment:
Can you also add an example with just `https://` as the `base_url` (and
whatever else you'd like after it), since you call it out in your comment?
##########
providers/http/src/airflow/providers/http/hooks/http.py:
##########
@@ -47,9 +47,18 @@
def _url_from_endpoint(base_url: str | None, endpoint: str | None) -> str:
"""Combine base url with endpoint."""
- if base_url and not base_url.endswith("/") and endpoint and not
endpoint.startswith("/"):
- return f"{base_url}/{endpoint}"
- return (base_url or "") + (endpoint or "")
+ if not base_url:
+ return endpoint or ""
+ if not endpoint:
+ return base_url
Review Comment:
```suggestion
return base_url
```
--
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]