diff options
| author | Jonas Lundberg <jonas@5monkeys.se> | 2022-05-30 22:45:48 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-05-31 08:38:00 +0200 |
| commit | f1e0fc645bb0b2c15d1510c9a8501743297dec9d (patch) | |
| tree | bd5aab51f0778e321b6c72e8ee65887f7479b81c /tests/asgi/urls.py | |
| parent | 292f372768836e2aebc713064c5139e8067eebcb (diff) | |
Fixed #33754 -- Fixed crash with prematurely closed ASGI request body.
Regression in 441103a04d1d167dc870eaaf90e3fba974f67c93.
Diffstat (limited to 'tests/asgi/urls.py')
| -rw-r--r-- | tests/asgi/urls.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/asgi/urls.py b/tests/asgi/urls.py index e6c74ab488..bd286c9b2f 100644 --- a/tests/asgi/urls.py +++ b/tests/asgi/urls.py @@ -2,6 +2,7 @@ import threading from django.http import FileResponse, HttpResponse from django.urls import path +from django.views.decorators.csrf import csrf_exempt def hello(request): @@ -23,6 +24,11 @@ def sync_waiter(request): return hello(request) +@csrf_exempt +def post_echo(request): + return HttpResponse(request.body) + + sync_waiter.active_threads = set() sync_waiter.lock = threading.Lock() sync_waiter.barrier = threading.Barrier(2) @@ -35,5 +41,6 @@ urlpatterns = [ path("", hello), path("file/", lambda x: FileResponse(open(test_filename, "rb"))), path("meta/", hello_meta), + path("post/", post_echo), path("wait/", sync_waiter), ] |
