diff options
| author | Khudyakov Artem <khudyak.artem@gmail.com> | 2024-07-29 22:05:10 +0300 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2025-03-27 08:57:03 -0300 |
| commit | 9aabe7eae3eeb3e64c5a0f3687118cd806158550 (patch) | |
| tree | bbc7cc8752b20fe850bc890d86e9df07b9d4958d /docs | |
| parent | 0d92428d77fafff373e05dd5a6cdb62bd1dfbda0 (diff) | |
Fixed #35440 -- Simplified parse_header_parameters by leveraging stdlid's Message.
The `parse_header_parameters` function historically used Python's `cgi`
module (now deprecated). In 34e2148fc725e7200050f74130d7523e3cd8507a,
the logic was inlined to work around this deprecation ( #33173). Later,
in d4d5427571b4bf3a21c902276c2a00215c2a37cc, the header parsing logic
was further cleaned up to align with `multipartparser.py` (#33697).
This change takes it a step further by replacing the copied `cgi` logic with
Python's `email.message.Message` API for a more robust and maintainable header
parsing implementation.
Thanks to Raphael Gaschignard for testing, and to Adam Johnson and Shai
Berger for reviews.
Co-authored-by: Ben Cail <bcail@crossway.org>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/6.0.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/releases/6.0.txt b/docs/releases/6.0.txt index 499163788f..fe090e3f2a 100644 --- a/docs/releases/6.0.txt +++ b/docs/releases/6.0.txt @@ -311,6 +311,10 @@ Miscellaneous * The :ref:`JSON <serialization-formats-json>` serializer now writes a newline at the end of the output, even without the ``indent`` option set. +* The undocumented ``django.utils.http.parse_header_parameters()`` function is + refactored to use Python's :py:class:`email.message.Message` for parsing. + Input headers exceeding 10000 characters will now raise :exc:`ValueError`. + .. _deprecated-features-6.0: Features deprecated in 6.0 |
