luoyuliuyin opened a new pull request, #45546:
URL: https://github.com/apache/airflow/pull/45546

   ### Apache Airflow version
   main (development)
   
   ### How to reproduce
   POST request with `content-type` as `application/json; charset=utf-8`
   ```
   curl -X 'PATCH' \
     'https://you_host_com/api/v1/dags/dag_id/dagRuns/run_id' \
     -H 'accept: application/json' \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d '{
     "state": "success"
   }'
   ```
   
   ### Problem Description
   When an API call is made, if the API has the `@action_logging` annotation, 
the event will be recorded in the db `log` table as follows
   
![image](https://github.com/user-attachments/assets/4f82db26-96e4-4085-a4e7-3b0f75f880c1)
   
   ### Related Code
   Currently, whether the current request contains json_body is determined by 
judging whether `request.headers.get("content-type")` is equal to 
`application/json`. The relevant code is as follows
   
![image](https://github.com/user-attachments/assets/f67c9a58-44b7-4582-be66-f4b7ace23fbc)
   
   
   But in many cases, the `content-type` contains other information besides 
`application/json`, such as `application/json; charset=utf-8`. In this case, 
the database will not record valid information.
   
![image](https://github.com/user-attachments/assets/a3637f3d-5536-415b-933b-d3b31752ab46)
   
   ### Solution
   So the judgment condition should be changed to include


-- 
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]

Reply via email to