(byte[] token)
| 86 | } |
| 87 | |
| 88 | private void parseHeader(byte[] token) { |
| 89 | if (token.length == 0) { // CR-LF on own line, end of headers |
| 90 | if (hasMultipleTransferLengths()) { |
| 91 | throw new IllegalStateException("multiple message lengths"); |
| 92 | } |
| 93 | Integer contentLength = findContentLength(); |
| 94 | if (contentLength == null) { |
| 95 | if (hasChunkedEncodingHeader()) { |
| 96 | state = State.CHUNK_SIZE; |
| 97 | } else { |
| 98 | body = EMPTY_BODY; |
| 99 | state = State.DONE; |
| 100 | } |
| 101 | } else { |
| 102 | this.contentLength = contentLength; |
| 103 | state = State.BODY; |
| 104 | } |
| 105 | } else { |
| 106 | headers.add(parseHeaderLine(token)); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | private static Header parseHeaderLine(byte[] line) { |
| 111 | int colonIndex = indexOfColon(line); |
nothing calls this directly
no test coverage detected