/** * Parses the HTTP messages' headers from the given input stream. * * @param inputStream supplying the header fields * @param createError error factory - used in case an error is encountered * @return the {@link RawHttpHeaders} * @throws IOException if an error occurs while consuming the stream */ public RawHttpHeaders parseHeaders(InputStream inputStream, BiFunction<String, Integer, RuntimeException> createError) throws IOException { RawHttpHeaders headers = buildHeaders(inputStream, createError).build(); options.getHttpHeadersOptions().getHeadersValidator().accept(headers); return headers; }
/** * Parses the HTTP messages' headers from the given input stream. * * @param inputStream supplying the header fields * @param createError error factory - used in case an error is encountered * @return the {@link RawHttpHeaders} * @throws IOException if an error occurs while consuming the stream */ public RawHttpHeaders parseHeaders(InputStream inputStream, BiFunction<String, Integer, RuntimeException> createError) throws IOException { RawHttpHeaders headers = buildHeaders(inputStream, createError).build(); options.getHttpHeadersOptions().getHeadersValidator().accept(headers); return headers; }
StringBuilder metadataBuilder = new StringBuilder(); int length = 0; int lengthLimit = options.getHttpHeadersOptions().getMaxHeaderNameLength(); parsingValue = true; length = -1; lengthLimit = options.getHttpHeadersOptions().getMaxHeaderValueLength(); } else if (c == '\n' || c == '\r') { throw createError.apply("Invalid header: missing the ':' separator", lineNumber);
StringBuilder metadataBuilder = new StringBuilder(); int length = 0; int lengthLimit = options.getHttpHeadersOptions().getMaxHeaderNameLength(); parsingValue = true; length = -1; lengthLimit = options.getHttpHeadersOptions().getMaxHeaderValueLength(); } else if (c == '\n' || c == '\r') { throw createError.apply("Invalid header: missing the ':' separator", lineNumber);