def read_header(self, data):
        data = data.strip()
        if data == '':
            self.donereading = True
            if self.headers.get('accept-encoding','').find('gzip') > -1:
                self.encoding = 'gzip'
            else:
                self.encoding = 'identity'
            r = self.handler.getfunc(self, self.path, self.headers)
            if r is not None:
                self.answer(r)
            return None
        try:
            i = data.index(':')
        except ValueError:
            return None
        self.headers[data[:i].strip().lower()] = data[i+1:].strip()
        if DEBUG:
            print data[:i].strip() + ": " + data[i+1:].strip()
        return self.read_header
dataset/ETHPy150Open Cclleemm/FriendlyTorrent/src/tornado/BitTornado/HTTPHandler.py/HTTPConnection.read_header/original