Merge pull request #13 from nvllsvm/warning

Log warning headers
This commit is contained in:
Gavin M. Roy 2018-09-21 11:14:06 -04:00 committed by GitHub
commit df5103fcb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -144,6 +144,12 @@ class HTTPClientMixin(object):
method, url, attempt + 1, method, url, attempt + 1,
max_http_attempts, error) max_http_attempts, error)
continue continue
warning_header = response.headers.get('Warning')
if warning_header is not None:
LOGGER.warning('HTTP Warning Header for %s to %s, '
'attempt %i of %i (%s): %s',
method, url, response.code, attempt + 1,
max_http_attempts, warning_header)
if 200 <= response.code < 400: if 200 <= response.code < 400:
raise gen.Return( raise gen.Return(
HTTPResponse( HTTPResponse(