Merge "Drain and close response in StaticLargeObject.get_slo_segments"

This commit is contained in:
Zuul 2022-07-26 01:05:32 +00:00 committed by Gerrit Code Review
commit f7cd2d905a
2 changed files with 3 additions and 0 deletions

View File

@ -1532,6 +1532,8 @@ class StaticLargeObject(object):
except ValueError:
raise HTTPServerError('Unable to load SLO manifest')
else:
# Drain and close GET request (prevents socket leaks)
drain_and_close(resp)
raise HTTPBadRequest('Not an SLO manifest')
elif resp.status_int == HTTP_NOT_FOUND:
raise HTTPNotFound('SLO manifest not found')

View File

@ -1490,6 +1490,7 @@ class TestSloDeleteManifest(SloTestCase):
self.assertEqual(resp_data['Number Not Found'], 0)
self.assertEqual(resp_data['Errors'],
[['/deltest/a_1', 'Not an SLO manifest']])
self.assertFalse(self.app.unread_requests)
def test_handle_multipart_delete_bad_json(self):
req = Request.blank(