summaryrefslogtreecommitdiff
path: root/tests/asgi
AgeCommit message (Collapse)Author
2026-04-07Fixed CVE-2026-33034 -- Enforced DATA_UPLOAD_MAX_MEMORY_SIZE on body size in ↵Natalia
ASGI requests. The `body` property in `HttpRequest` checks DATA_UPLOAD_MAX_MEMORY_SIZE against the declared `Content-Length` header before reading. On the ASGI path, chunked requests carry no `Content-Length`, so the check evaluated to 0 and always passed regardless of the actual body size. This work adds a new check on the actual number of bytes consumed. Thanks to Superior for the report, and to Jake Howard and Jacob Walls for reviews.
2026-04-07Fixed CVE-2026-3902 -- Ignored headers with underscores in ASGIRequest.Jacob Walls
Thanks Tarek Nakkouch for the report and Jake Howard and Natalia Bidart for reviews.
2026-02-03Fixed CVE-2025-14550 -- Optimized repeated header parsing in ASGI requests.Jake Howard
Thanks Jiyong Yang for the report, and Natalia Bidart, Jacob Walls, and Shai Berger for reviews.
2026-01-23Refs #33735 -- Coped with stacklevel change in ASGITest.test_file_response().Jacob Walls
Follow-up to c042fe3a74fb213c93b1052f7de4d99a6e6948e0. The original ignore was added in 0bd2c0c9015b53c41394a1c0989afbfd94dc2830 but was not adjusted when the stacklevel changed.
2025-08-21Fixed #36399 -- Added support for multiple Cookie headers in HTTP/2 for ↵SaJH
ASGIRequest. Signed-off-by: SaJH <wogur981208@gmail.com>
2025-06-18Refs #36467 -- Added test for Set-Cookie header values in ASGIHandler.Sarah Boyce
2025-05-04Fixed #36281 -- Used async-safe write in ASGIHandler.read_body().신우진
Thanks Carlton Gibson for reviews.
2025-03-30Fixed warnings per flake8 7.2.0.Mariusz Felisiak
https://github.com/PyCQA/flake8/releases/tag/7.2.0
2024-11-27Refs #33735 -- Captured stderr during ASGITest.test_file_response.Jacob Walls
2024-05-28Refs #35059 -- Used asyncio.Event in ASGITest.test_asyncio_cancel_error to ↵Carlton Gibson
enforce specific interleaving. Sleep call leads to a hard to trace error in CI. Using an Event is more deterministic, and should be less prone to environment variations. Bug in 11393ab1316f973c5fbb534305750740d909b4e4.
2024-01-31Fixed #35059 -- Ensured that ASGIHandler always sends the request_finished ↵James Thorniley
signal. Prior to this work, when async tasks that process the request are cancelled due to receiving an early "http.disconnect" ASGI message, the request_finished signal was not being sent, potentially leading to resource leaks (such as database connections). This branch ensures that the request_finished signal is sent even in the case of early termination of the response. Regression in 64cea1e48f285ea2162c669208d95188b32bbc82. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com> Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2024-01-31Refs #35059 -- Made asgi tests' SignalHandler helper class re-usable by ↵Natalia
other tests.
2023-12-31Used addCleanup() in tests where appropriate.Mariusz Felisiak
2023-09-11Fixed #34752 -- Fixed handling ASGI http.disconnect for streaming responses.Sam Toyer
2023-04-03Fixed #33738 -- Allowed handling ASGI http.disconnect in long-lived requests.th3nn3ss
2023-03-21Fixed #34428 -- Made ASGIStaticFilesHandler adapt response to async iterator.Carlton Gibson
Bug in 0bd2c0c9015b53c41394a1c0989afbfd94dc2830.
2023-03-20Fixed some typos in comments, docstrings, and tests.Liyang Zhang
2022-12-22Fixed #33735 -- Added async support to StreamingHttpResponse.Carlton Gibson
Thanks to Florian Vazelle for initial exploratory work, and to Nick Pope and Mariusz Felisiak for review.
2022-08-04Refs #33173, Refs #33755 -- Fixed ResourceWarning from unclosed files in ↵Carlton Gibson
ASGI tests.
2022-06-09Fixed #33755 -- Moved ASGI body-file cleanup into request class.Jonas Lundberg
2022-05-31Fixed #33754 -- Fixed crash with prematurely closed ASGI request body.Jonas Lundberg
Regression in 441103a04d1d167dc870eaaf90e3fba974f67c93.
2022-04-14Removed stale Windows asyncio test skips.Carlton Gibson
Underlying issue was fixed in Python 3.8.1, now many versions ago. https://bugs.python.org/issue38563
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-07-01Fixed #32889 -- Allowed per-request sync_to_async context in ASGIHandler .Allan Feldman
By using a asgiref's ThreadSensitiveContext context manager, requests will be able to execute independently of other requests when sync work is involved. Prior to this commit, a single global thread was used to execute any sync work independent of the request from which that work was scheduled. This could result in contention for the global sync thread in the case of a slow sync function. Requests are now isolated to their own sync thread.
2021-02-06Refs #32394 -- Changed STATIC_URL/MEDIA_URL to relative paths in tests and ↵Markus Holtermann
docs where appropriate.
2020-11-05Fixed #31550 -- Adjusted ASGI test_file_response for various Windows content ↵Christopher Keith
types.
2020-06-08Fixed #31594 -- Added ASGIStaticFilesHandler.get_response_async().Joshua Massover
2020-05-06Fixed #31515 -- Made ASGIHandler dispatch lifecycle signals with thread ↵Carlton Gibson
sensitive.
2020-03-18Fixed #31224 -- Added support for asynchronous views and middleware.Andrew Godwin
This implements support for asynchronous views, asynchronous tests, asynchronous middleware, and an asynchronous test client.
2020-03-05Refs #31224 -- Added autoconversion of test async methods.Andrew Godwin
2019-11-06Harmonized Windows checks in tests to a single style.Jon Dufresne
2019-10-24Fixed #30900 -- Skipped async-related tests on Windows using Python 3.8.0.Carlton Gibson
Refs https://bugs.python.org/issue38563.
2019-06-20Refs #30451 -- Added more tests for ASGIRequest and ASGIHandler.Mariusz Felisiak
2019-06-20Fixed #30451 -- Added ASGI handler and coroutine-safety.Andrew Godwin
This adds an ASGI handler, asgi.py file for the default project layout, a few async utilities and adds async-safety to many parts of Django.