<feed xmlns='http://www.w3.org/2005/Atom'>
<title>django.git/django/utils/http.py, branch 6.0.2</title>
<subtitle>django
</subtitle>
<id>http://cgit.adnoto.dev/django.git/atom?h=6.0.2</id>
<link rel='self' href='http://cgit.adnoto.dev/django.git/atom?h=6.0.2'/>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/'/>
<updated>2025-11-26T20:19:18Z</updated>
<entry>
<title>[6.0.x] Fixed #36743 -- Increased URL max length enforced in HttpResponseRedirectBase.</title>
<updated>2025-11-26T20:19:18Z</updated>
<author>
<name>varunkasyap</name>
<email>varunkasyap@hotmail.com</email>
</author>
<published>2025-11-26T17:28:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=ce7d65fc8156e6b1e2163c3988eecbf214a8b031'/>
<id>urn:sha1:ce7d65fc8156e6b1e2163c3988eecbf214a8b031</id>
<content type='text'>
Refs CVE-2025-64458.

The previous limit of 2048 characters reused the URLValidator constant
and proved too restrictive for legitimate redirects to some third-party
services. This change introduces a separate `MAX_URL_REDIRECT_LENGTH`
constant (defaulting to 16384) and uses it in HttpResponseRedirectBase.

Thanks Jacob Walls for report and review.

Backport of a8cf8c292cfee98fe6cc873ca5221935f1d02271 from main.
</content>
</entry>
<entry>
<title>Fixed #36520 -- Reverted "Fixed #35440 -- Simplified parse_header_parameters by leveraging stdlid's Message."</title>
<updated>2025-09-16T01:14:50Z</updated>
<author>
<name>Natalia</name>
<email>124304+nessita@users.noreply.github.com</email>
</author>
<published>2025-09-15T14:45:20Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=424e0d86973d88b402b55f20884938715aad740b'/>
<id>urn:sha1:424e0d86973d88b402b55f20884938715aad740b</id>
<content type='text'>
This partially reverts commit 9aabe7eae3eeb3e64c5a0f3687118cd806158550.

The simplification of parse_header_parameters using stdlib's Message
is reverted due to a performance regression. The check for the header
maximum length remains in place, per Security Team guidance.

Thanks to David Smith for reporting the regression, and Jacob Walls for
the review.
</content>
</entry>
<entry>
<title>Refs #36500 -- Rewrapped long docstrings and block comments via a script.</title>
<updated>2025-07-23T23:17:55Z</updated>
<author>
<name>django-bot</name>
<email>ops@djangoproject.com</email>
</author>
<published>2025-07-23T03:41:41Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=69a93a88edb56ba47f624dac7a21aacc47ea474f'/>
<id>urn:sha1:69a93a88edb56ba47f624dac7a21aacc47ea474f</id>
<content type='text'>
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
</content>
</entry>
<entry>
<title>Fixed CVE-2025-27556 -- Mitigated potential DoS in url_has_allowed_host_and_scheme() on Windows.</title>
<updated>2025-04-02T08:21:33Z</updated>
<author>
<name>Sarah Boyce</name>
<email>42296566+sarahboyce@users.noreply.github.com</email>
</author>
<published>2025-03-06T14:24:56Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=39e2297210d9d2938c75fc911d45f0e863dc4821'/>
<id>urn:sha1:39e2297210d9d2938c75fc911d45f0e863dc4821</id>
<content type='text'>
Thank you sw0rd1ight for the report.
</content>
</entry>
<entry>
<title>Fixed #35440 -- Simplified parse_header_parameters by leveraging stdlid's Message.</title>
<updated>2025-03-27T11:57:03Z</updated>
<author>
<name>Khudyakov Artem</name>
<email>khudyak.artem@gmail.com</email>
</author>
<published>2024-07-29T19:05:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=9aabe7eae3eeb3e64c5a0f3687118cd806158550'/>
<id>urn:sha1:9aabe7eae3eeb3e64c5a0f3687118cd806158550</id>
<content type='text'>
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 &lt;bcail@crossway.org&gt;
Co-authored-by: Natalia &lt;124304+nessita@users.noreply.github.com&gt;
</content>
</entry>
<entry>
<title>Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.</title>
<updated>2025-02-18T07:35:36Z</updated>
<author>
<name>Mariusz Felisiak</name>
<email>felisiak.mariusz@gmail.com</email>
</author>
<published>2025-02-18T07:35:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=efb7f9ced2dcf71294353596a265e3fd67faffeb'/>
<id>urn:sha1:efb7f9ced2dcf71294353596a265e3fd67faffeb</id>
<content type='text'>
datetime.UTC was added in Python 3.11.</content>
</entry>
<entry>
<title>Fixed #36023 -- Handled controls chars in content_disposition_header.</title>
<updated>2025-01-07T08:22:09Z</updated>
<author>
<name>Alex Vandiver</name>
<email>alex@chmrr.net</email>
</author>
<published>2024-12-06T15:47:31Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=8914b571eb5f93722b9741b1da9eb69347271b11'/>
<id>urn:sha1:8914b571eb5f93722b9741b1da9eb69347271b11</id>
<content type='text'>
To use the simple `filename="..."` form, the value must conform to the
official grammar from RFC6266[^1]:

    filename-parm       = "filename" "=" value
    value               = &lt;value, defined in [RFC2616], Section 3.6&gt;
                        ; token | quoted-string

The `quoted-string` definition comes from RFC 9110[^2]:

```
    quoted-string  = DQUOTE *( qdtext / quoted-pair ) DQUOTE
    qdtext         = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text

The backslash octet ("\") can be used as a single-octet quoting
mechanism within quoted-string and comment constructs. Recipients that
process the value of a quoted-string MUST handle a quoted-pair as if
it were replaced by the octet following the backslash.

    quoted-pair    = "\" ( HTAB / SP / VCHAR / obs-text )

A sender SHOULD NOT generate a quoted-pair in a quoted-string except
where necessary to quote DQUOTE and backslash octets occurring within
that string.
```

That is, quoted strings are able to express horizontal tabs, space
characters, and everything in the range from 0x21 to 0x7e, expect for
0x22 (`"`) and 0x5C (`\`), which can still be expressed but must be
escaped with their own `\`.

We ignore the case of `obs-text`, which is defined as the range
0x80-0xFF, since its presence is there for permissive parsing of
accidental high-bit characters, and it should not be generated by
conforming implementations.

Transform this character range into a regex and apply it in addition
to the "is ASCII" check.  This ensures that all simple filenames are
expressed in the simple format, and that all filenames with newlines
and other control characters are properly expressed with the
percent-encoded `filename*=...`form.

[^1]: https://datatracker.ietf.org/doc/html/rfc6266#section-4.1
[^2]: https://datatracker.ietf.org/doc/html/rfc9110#name-quoted-strings
</content>
</entry>
<entry>
<title>Fixed 35467 -- Replaced urlparse with urlsplit where appropriate.</title>
<updated>2024-05-29T13:48:27Z</updated>
<author>
<name>Jake Howard</name>
<email>RealOrangeOne@users.noreply.github.com</email>
</author>
<published>2024-05-29T13:48:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=ff308a06047cd60806d604a7cf612e5656ee2ac9'/>
<id>urn:sha1:ff308a06047cd60806d604a7cf612e5656ee2ac9</id>
<content type='text'>
This work should not generate any change of functionality, and
`urlsplit` is approximately 6x faster.

Most use cases of `urlparse` didn't touch the path, so they can be
converted to `urlsplit` without any issue. Most of those which do use
`.path`, simply parse the URL, mutate the querystring, then put them
back together, which is also fine (so long as urlunsplit is used).</content>
</entry>
<entry>
<title>Refs #34986 -- Fixed mocking in utils_tests.test_http.HttpDateProcessingTests.test_parsing_rfc850.</title>
<updated>2023-11-28T05:19:38Z</updated>
<author>
<name>Nick Pope</name>
<email>nick@nickpope.me.uk</email>
</author>
<published>2023-11-21T17:13:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=6089230d3ec580f2f44e85f23962c14905fefcfd'/>
<id>urn:sha1:6089230d3ec580f2f44e85f23962c14905fefcfd</id>
<content type='text'>
Mocking in the `datetime` module can be tricky. In CPython the datetime
C module is used, but PyPy uses a pure Python implementation. This
caused issues with the prior approach to mocking `datetime.datetime`.

See https://docs.python.org/3/library/unittest.mock-examples.html#partial-mocking
</content>
</entry>
<entry>
<title>Refs #34233 -- Used str.removeprefix()/removesuffix().</title>
<updated>2023-01-18T18:11:18Z</updated>
<author>
<name>Mariusz Felisiak</name>
<email>felisiak.mariusz@gmail.com</email>
</author>
<published>2023-01-18T18:11:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=23e886886249ebe8f80a48b0d25fbb5308eeb06f'/>
<id>urn:sha1:23e886886249ebe8f80a48b0d25fbb5308eeb06f</id>
<content type='text'>
</content>
</entry>
</feed>
