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

   
   Fixes https://github.com/apache/airflow/issues/68065.
   
   When `PATCH /api/v2/variables/{variable_key}` receives an encoded leading 
slash as the path parameter, the route can see `%2Ffoo` while the immutable 
body key is correctly `/foo`. The existing mismatch guard then rejects the 
request before the variable lookup.
   
   This changes the PATCH route to decode the path key once only when the 
decoded value exactly matches the request body's `key`. Literal keys containing 
`%2F` are still preserved when the body key matches the literal path value.
   
   ## Tests
   
   ```bash
   /opt/anaconda3/bin/uv run ruff format 
airflow-core/src/airflow/api_fastapi/core_api/routes/public/variables.py 
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py
   /opt/anaconda3/bin/uv run ruff check --fix 
airflow-core/src/airflow/api_fastapi/core_api/routes/public/variables.py 
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py
   /opt/anaconda3/bin/uv run --project airflow-core pytest 
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py::TestPatchVariable
 -xvs
   /opt/anaconda3/bin/uv run --project airflow-core pytest 
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py -q


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