Skip to content
Snippets Groups Projects
Commit 60e060f4 authored by durin42's avatar durin42
Browse files

hgweb: force connection close on early response

Not all WSGI servers close the socket when an early response is sent
to a large POST request, which can cause the server to interpret the
already-sent request body as an incoming (but hopelessly invalid)
request.
parent 8cfa3a36
No related branches found
No related tags found
No related merge requests found
......@@ -176,6 +176,8 @@
'').lower() != '100-continue') or
req.env.get('X-HgHttp2', '')):
req.drain()
else:
req.headers.append(('Connection', 'Close'))
req.respond(inst, protocol.HGTYPE,
body='0\n%s\n' % inst.message)
return ''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment