﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30059	DELETE request with payload makes subsequent request fail	Dmytro Yurchenko	nobody	"In my application I use a frontend component FilePond (https://pqina.nl/filepond/) to perform photo file uploads.
FilePond uses its own server protocol to manage temp files on the backend and sends a photo ID as a payload for DELETE request. According to RFC7231: ""payload within a DELETE request message has no defined semantics"", but it isn't forbidden. Django development server can't process a request that follows DELETE with payload as it regards the payload to be a part of the next request's first line. 
For example when photo ID is '0', next request is logged like this:
{{{
""0POST /accounts/profile/photo/ HTTP/1.1"" 405 0
}}}
Quick and dirty fix for my View subclass is:
{{{
def delete(self, request):
    # Drain the incoming buffer
    request._stream.read()
    ...
    return HttpResponse(status=204)
}}}
When incoming data are wholly consumed by DELETE handler, subsequent requests work as expected.

Best regards,
Dmytro Yurchenko"	Bug	closed	HTTP handling	2.1	Normal	duplicate			Unreviewed	0	0	0	0	0	0
