uranusjr commented on a change in pull request #20730:
URL: https://github.com/apache/airflow/pull/20730#discussion_r795384962
##########
File path: airflow/www/decorators.py
##########
@@ -34,6 +34,15 @@
logger = logging.getLogger(__name__)
+def _get_dag_id() -> str:
+ dag_id = request.args.get('dag_id')
+ if dag_id:
+ return dag_id
+ path_parts = request.path.split('/')
+ if len(path_parts) >= 3 and path_parts[1] == 'dags':
+ return path_parts[2]
Review comment:
Instead of relying on the `/dags/<dag_id>` structure, it is likely
better to use
[`request.endpoint`](https://flask.palletsprojects.com/en/1.1.x/api/?highlight=request#flask.Request.endpoint)
to get the `dag_id` component in the path instead.
--
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]