def _read_additional_headers(self, data):
        if not self._requests:
            return
        request = self._requests[0]
        response = request.response
        self._reset_timer()

        # Build the additional headers data.
        if data:
            response._additional_headers += data + CRLF
            return

        # We're done, so parse those.
        headers = read_headers(response._additional_headers)
        del response._additional_headers

        # Extend the original headers.
        for key, val in headers.iteritems():
            if not key in response.headers:
                response.headers[key] = val
            else:
                if not isinstance(response.headers[key], list):
                    response.headers[key] = [response.headers[key]]
                if isinstance(val, (tuple,list)):
                    response.headers[key].extend(val)
                else:
                    response.headers[key].append(val)

        # Finally, we can handle it.
        self._on_response()
Read additional headers for the response.
dataset/ETHPy150Open ecdavis/pants/pants/http/client.py/HTTPClient._read_additional_headers