You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "eumiro (via GitHub)" <gi...@apache.org> on 2023/08/09 17:52:23 UTC
[GitHub] [airflow] eumiro commented on a diff in pull request #33234: Refactor: Simplify code in smaller providers
eumiro commented on code in PR #33234:
URL: https://github.com/apache/airflow/pull/33234#discussion_r1288976150
##########
airflow/providers/http/hooks/http.py:
##########
@@ -340,31 +340,18 @@ async def run(
if headers:
_headers.update(headers)
- if self.base_url and not self.base_url.endswith("/") and endpoint and not endpoint.startswith("/"):
- url = self.base_url + "/" + endpoint
- else:
- url = (self.base_url or "") + (endpoint or "")
+ url = "/".join([(self.base_url or "").rstrip("/"), (endpoint or "").lstrip("/")])
Review Comment:
This is nice.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org