def _read_http_header(self, header):
try:<EOL><INDENT>startline, headerfield = header.split(b'<STR_LIT:\r\n>', <NUM_LIT:1>)<EOL>para1, para2, para3 = re.split(rb'<STR_LIT>', startline, <NUM_LIT:2>)<EOL>fields = headerfield.split(b'<STR_LIT:\r\n>')<EOL>lists = (re.split(rb'<STR_LIT>', field, <NUM_LIT:1>) for field in fields)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ProtocolError('<STR_LIT>', quiet=True)<EOL><DEDENT>match1 = re.match(_RE_METHOD, para1)<EOL>match2 = re.match(_RE_VERSION, para3)<EOL>match3 = re.match(_RE_VERSION, para1)<EOL>match4 = re.match(_RE_STATUS, para2)<EOL>if match1 and match2:<EOL><INDENT>receipt = '<STR_LIT>'<EOL>header = dict(<EOL>request=dict(<EOL>method=self.decode(para1),<EOL>target=self.decode(para2),<EOL>version=self.decode(match2.group('<STR_LIT:version>')),<EOL>),<EOL>)<EOL><DEDENT>elif match3 and match4:<EOL><INDENT>receipt = '<STR_LIT>'<EOL>header = dict(<EOL>response=dict(<EOL>version=self.decode(match3.group('<STR_LIT:version>')),<EOL>status=int(para2),<EOL>phrase=self.decode(para3),<EOL>),<EOL>)<EOL><DEDENT>else:<EOL><INDENT>raise ProtocolError('<STR_LIT>', quiet=True)<EOL><DEDENT>try:<EOL><INDENT>for item in lists:<EOL><INDENT>key = self.decode(item[<NUM_LIT:0>].strip()).replace(receipt, f'<STR_LIT>')<EOL>value = self.decode(item[<NUM_LIT:1>].strip())<EOL>if key in header:<EOL><INDENT>if isinstance(header[key], tuple):<EOL><INDENT>header[key] += (value,)<EOL><DEDENT>else:<EOL><INDENT>header[key] = (header[key], value)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>header[key] = value<EOL><DEDENT><DEDENT><DEDENT>except IndexError:<EOL><INDENT>raise ProtocolError('<STR_LIT>', quiet=True)<EOL><DEDENT>return header, receipt<EOL>
Read HTTP/1.* header.

        Structure of HTTP/1.* header [RFC 7230]:
            start-line      :==:    request-line / status-line
            request-line    :==:    method SP request-target SP HTTP-version CRLF
            status-line     :==:    HTTP-version SP status-code SP reason-phrase CRLF
            header-field    :==:    field-name ":" OWS field-value OWS