sudiptob2 commented on PR #37638:
URL: https://github.com/apache/airflow/pull/37638#issuecomment-1963045368
We might be able to handle `csrf` exemption logic in the following way.
```python3
@connexion_app.app.before_request
def before_request():
"""Exempts the view function associated with '/api/v1' requests from
CSRF protection."""
if request.path.startswith("/api/v1"): # TODO: make sure this path
is correct
view_function = flask_app.view_functions.get(request.endpoint)
if view_function:
# Exempt the view function from CSRF protection
connexion_app.app.extensions["csrf"].exempt(view_function)
```
I implemented it [here](https://github.com/sudiptob2/airflow/pull/3/files#),
asking for a review @vincbeck @potiuk
--
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]