<feed xmlns='http://www.w3.org/2005/Atom'>
<title>django.git/tests/utils_tests/test_http.py, branch stable/5.2.x</title>
<subtitle>django
</subtitle>
<id>http://cgit.adnoto.dev/django.git/atom?h=stable%2F5.2.x</id>
<link rel='self' href='http://cgit.adnoto.dev/django.git/atom?h=stable%2F5.2.x'/>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/'/>
<updated>2025-04-02T08:23:46Z</updated>
<entry>
<title>[5.2.x] Fixed CVE-2025-27556 -- Mitigated potential DoS in url_has_allowed_host_and_scheme() on Windows.</title>
<updated>2025-04-02T08:23:46Z</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=2cb311f7b069723027fb5def4044d1816d7d2afd'/>
<id>urn:sha1:2cb311f7b069723027fb5def4044d1816d7d2afd</id>
<content type='text'>
Thank you sw0rd1ight for the report.

Backport of 39e2297210d9d2938c75fc911d45f0e863dc4821 from main.
</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>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 #30116 -- Simplified tests related with dictionary order.</title>
<updated>2023-07-12T09:06:59Z</updated>
<author>
<name>Mariusz Felisiak</name>
<email>felisiak.mariusz@gmail.com</email>
</author>
<published>2023-07-12T09:06:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=4afaeb14c293725d7b2530788083fce1c120ff65'/>
<id>urn:sha1:4afaeb14c293725d7b2530788083fce1c120ff65</id>
<content type='text'>
Dicts preserve order since Python 3.6.</content>
</entry>
<entry>
<title>Fixed #34194 -- Added django.utils.http.content_disposition_header().</title>
<updated>2022-12-05T12:08:00Z</updated>
<author>
<name>Alex Vandiver</name>
<email>alex@chmrr.net</email>
</author>
<published>2022-11-30T20:09:49Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=cbce427c17b66faec7ced0639346dc6905a498f9'/>
<id>urn:sha1:cbce427c17b66faec7ced0639346dc6905a498f9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Updated documentation and comments for RFC updates.</title>
<updated>2022-11-10T12:52:17Z</updated>
<author>
<name>Nick Pope</name>
<email>nick@nickpope.me.uk</email>
</author>
<published>2022-11-04T12:33:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=9bd174b9a75299dce33e673a559f2b673399b971'/>
<id>urn:sha1:9bd174b9a75299dce33e673a559f2b673399b971</id>
<content type='text'>
- Updated references to RFC 1123 to RFC 5322
  - Only partial as RFC 5322 sort of sub-references RFC 1123.
- Updated references to RFC 2388 to RFC 7578
  - Except RFC 2388 Section 5.3 which has no equivalent.
- Updated references to RFC 2396 to RFC 3986
- Updated references to RFC 2616 to RFC 9110
- Updated references to RFC 3066 to RFC 5646
- Updated references to RFC 7230 to RFC 9112
- Updated references to RFC 7231 to RFC 9110
- Updated references to RFC 7232 to RFC 9110
- Updated references to RFC 7234 to RFC 9111
- Tidied up style of text when referring to RFC documents
</content>
</entry>
<entry>
<title>Updated vendored _urlsplit() to strip newline and tabs.</title>
<updated>2022-07-01T06:48:38Z</updated>
<author>
<name>Michael Manfre</name>
<email>mike@manfre.net</email>
</author>
<published>2022-06-30T00:39:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=03eec9ff6cc78e7c1bcf88bb76ecd11f0d433c72'/>
<id>urn:sha1:03eec9ff6cc78e7c1bcf88bb76ecd11f0d433c72</id>
<content type='text'>
Refs Python CVE-2022-0391. Django is not affected, but others who
incorrectly use internal function url_has_allowed_host_and_scheme()
with unsanitized input could be at risk.
</content>
</entry>
<entry>
<title>Refs #33697 -- Used django.utils.http.parse_header_parameters() for parsing boundary streams.</title>
<updated>2022-06-28T07:42:47Z</updated>
<author>
<name>Mehrdad</name>
<email>mhrddmoradii@gmail.com</email>
</author>
<published>2022-06-24T18:46:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=d4d5427571b4bf3a21c902276c2a00215c2a37cc'/>
<id>urn:sha1:d4d5427571b4bf3a21c902276c2a00215c2a37cc</id>
<content type='text'>
This also removes unused parse_header() and _parse_header_params()
helpers in django.http.multipartparser.
</content>
</entry>
<entry>
<title>Refs #33173 -- Removed use of deprecated cgi module.</title>
<updated>2022-05-11T12:06:31Z</updated>
<author>
<name>Carlton Gibson</name>
<email>carlton.gibson@noumenal.es</email>
</author>
<published>2022-05-10T10:12:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=34e2148fc725e7200050f74130d7523e3cd8507a'/>
<id>urn:sha1:34e2148fc725e7200050f74130d7523e3cd8507a</id>
<content type='text'>
https://peps.python.org/pep-0594/#cgi
</content>
</entry>
<entry>
<title>Refs #33476 -- Reformatted code with Black.</title>
<updated>2022-02-07T19:37:05Z</updated>
<author>
<name>django-bot</name>
<email>ops@djangoproject.com</email>
</author>
<published>2022-02-03T19:24:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=9c19aff7c7561e3a82978a272ecdaad40dda5c00'/>
<id>urn:sha1:9c19aff7c7561e3a82978a272ecdaad40dda5c00</id>
<content type='text'>
</content>
</entry>
</feed>
