Merge "gendoc: allow DELETE to have body"

This commit is contained in:
Jenkins 2016-09-14 19:04:15 +00:00 committed by Gerrit Code Review
commit 5930d1ddcd

View File

@ -116,6 +116,16 @@ def setup(app):
fake_file.write(template.render(scenarios=scenarios).encode('utf-8')) fake_file.write(template.render(scenarios=scenarios).encode('utf-8'))
fake_file.seek(0) fake_file.seek(0)
request = webapp.RequestClass.from_file(fake_file) request = webapp.RequestClass.from_file(fake_file)
# TODO(jd) Fix this lame bug in webob
if request.method in ("DELETE"):
# Webob has a bug it does not read the body for DELETE, l4m3r
clen = request.content_length
if clen is None:
request.body = fake_file.read()
else:
request.body = fake_file.read(clen)
app.info("Doing request %s: %s" % (entry['name'], app.info("Doing request %s: %s" % (entry['name'],
six.text_type(request))) six.text_type(request)))
with webapp.use_admin_user(): with webapp.use_admin_user():