runserver request body limitations

124 views
Skip to first unread message

Justin Karneges

unread,
Jul 1, 2015, 4:07:02 PM7/1/15
to django-users
Hi folks,

I'm running into trouble doing a PUT with chunked encoded request body when the size exceeds around 35K. This is with runserver, so there's no Apache or wsgi or anything here.

Are there any request body size limits in Django or specifically in runserver? Trying to isolate whether this issue is on the sender side or Django side.

Thanks,
Justin

Avraham Serour

unread,
Jul 1, 2015, 5:11:02 PM7/1/15
to django-users

What do you mean by trouble, be more specific


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKFnGOS9GpimmhOkFKyyS9%3DOG65ofUibdqhwBso%2BR3q94Uvn8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Justin Karneges

unread,
Jul 1, 2015, 7:18:10 PM7/1/15
to django-users
It appears that once a certain size is exceeded, the request body is not received at all or truncated to 0.

Here's a minimal view that echos the request body:

def echo(request):
        return HttpResponse(request.body)

Then I'm sending files like this:

curl -v -X PUT --data-binary @file -H "Transfer-Encoding: chunked" http://localhost:8000/echo/

The runserver output will display 0 bytes sent if I try to send a too big file:

[01/Jul/2015 23:15:05]"PUT /echo/ HTTP/1.1" 200 0

Justin Karneges

unread,
Jul 1, 2015, 7:55:35 PM7/1/15
to django-users
Hmm, possibly it could be that chunked encoded request bodies are not supported:
http://osdir.com/ml/modwsgi/2010-09/msg00091.html

(As for how I managed to send 35K earlier, maybe it was some kind of packetization luck. I'm unable to reproduce it now. The Django app keeps seeing 0 bytes for a chunked upload).
Reply all
Reply to author
Forward
0 new messages