pierrejeambrun commented on code in PR #49013:
URL: https://github.com/apache/airflow/pull/49013#discussion_r2035754416
##########
airflow-core/src/airflow/api_fastapi/core_api/security.py:
##########
@@ -329,14 +329,23 @@ def _requires_access(
raise HTTPException(status.HTTP_403_FORBIDDEN, "Forbidden")
-def is_safe_url(target_url: str) -> bool:
+def is_safe_url(target_url: str, request: Request | None = None) -> bool:
"""
Check that the URL is safe.
Needs to belong to the same domain as base_url, use HTTP or HTTPS (no
JavaScript/data schemes),
is a valid normalized path.
"""
- base_url = conf.get("api", "base_url")
+ base_url: str | None = conf.get("api", "base_url")
Review Comment:
yes but if it's empty, we then take it from the `referer` header of the
request. Which might be missing...
But i agree this is confusing and need to be cleaned.
--
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]