Files
swift/test/unit/common/middleware/helpers.py
Kota Tsuyuzaki e747f94313 Fix InternalClient to drain response body if the request fails
If we don't drain the body, the proxy logging in the internal client
pipeline will log 499 client disconnect instead of actual error response
code.

For error responses, we try to do the most helpful thing using swob's
closing and caching response body attribute.  For non-error responses
which are returned to the client, we endeavour to keep the app_iter
intact and unconsumed, trusting expecting the caller to do the right
thing is the only reasonable interface.  We must cleanly close any WSGI
app_iter which we do not return to the client regardless of status code
and allow the logging of the 499 if needed.

Closes-Bug: #1675650
Change-Id: I455b5c38074ad0e72aa5e0b05771e193208905eb
2018-01-17 15:30:55 +09:00

8.0 KiB