'Return the content-length of this response as best as we can tell.
If the application returned a Content-Length header we will trust it.
If not, we are allowed by PEP-333 to attempt to determine the length of
the app\'s iterable and if it\'s 1, use the length of the only chunk as
the content-length.'

@staticmethod
def content_length(headers, app_iter):

    content_length_header = headers['Content-Length']
    if content_length_header:
        return int(content_length_header)
    try:
        app_iter_len = len(app_iter)
    except ValueError:
        return None
    if (app_iter_len == 1):
        return len(app_iter[0])
    return None
