ArmeriaHttpUtil { public static void toNettyHttp1ServerHeader( HttpHeaders inputHeaders, io.netty.handler.codec.http.HttpHeaders outputHeaders) { toNettyHttp1Server(inputHeaders, outputHeaders, false); HttpUtil.setKeepAlive(outputHeaders, HttpVersion.HTTP_1_1, true); } private  ArmeriaHttpUtil(); static String concatPaths(@Nullable String path1, @Nullable String path2); static String decodePath(String path); static boolean isAbsoluteUri(@Nullable String maybeUri); static boolean isInformational(@Nullable String statusText); static boolean isContentAlwaysEmptyWithValidation(HttpStatus status, HttpData content); static boolean isCorsPreflightRequest(com.linecorp.armeria.common.HttpRequest request); static void parseDirectives(String directives, BiConsumer<String, String> callback); static long parseDirectiveValueAsSeconds(@Nullable String value); static RequestHeaders toArmeriaRequestHeaders(ChannelHandlerContext ctx, Http2Headers headers,
                                                         boolean endOfStream, String scheme,
                                                         ServerConfig cfg); static HttpHeaders toArmeria(Http2Headers headers, boolean request, boolean endOfStream); static RequestHeaders toArmeria(ChannelHandlerContext ctx, HttpRequest in,
                                           ServerConfig cfg); static ResponseHeaders toArmeria(HttpResponse in); static HttpHeaders toArmeria(io.netty.handler.codec.http.HttpHeaders inHeaders); static void toArmeria(io.netty.handler.codec.http.HttpHeaders inHeaders, HttpHeadersBuilder out); static Http2Headers toNettyHttp2ServerHeaders(HttpHeaders inputHeaders); static Http2Headers toNettyHttp2ServerTrailer(HttpHeaders inputHeaders); static Http2Headers toNettyHttp2ClientHeader(HttpHeaders inputHeaders); static Http2Headers toNettyHttp2ClientTrailer(HttpHeaders inputHeaders); static void toNettyHttp1ServerHeader(
            HttpHeaders inputHeaders, io.netty.handler.codec.http.HttpHeaders outputHeaders); static void toNettyHttp1ServerTrailer(
            HttpHeaders inputHeaders, io.netty.handler.codec.http.HttpHeaders outputHeaders); static void toNettyHttp1ClientHeader(
            HttpHeaders inputHeaders, io.netty.handler.codec.http.HttpHeaders outputHeaders); static void toNettyHttp1ClientTrailer(
            HttpHeaders inputHeaders, io.netty.handler.codec.http.HttpHeaders outputHeaders); static ResponseHeaders setOrRemoveContentLength(ResponseHeaders headers, HttpData content,
                                                           HttpHeaders trailers); static boolean isTrailerBlacklisted(AsciiString name); static String authorityHeader(String host, int port, int defaultPort); static final Charset HTTP_DEFAULT_CONTENT_CHARSET; static final AsciiString HEADER_NAME_KEEP_ALIVE; static final AsciiString HEADER_NAME_PROXY_CONNECTION; static final String SERVER_HEADER; }
@Test void excludeBlacklistHeadersWhileHttp2ToHttp1() { final HttpHeaders in = HttpHeaders.builder() .add(HttpHeaderNames.TRAILER, "foo") .add(HttpHeaderNames.HOST, "bar") .add(HttpHeaderNames.PATH, "dummy") .add(HttpHeaderNames.METHOD, "dummy") .add(HttpHeaderNames.SCHEME, "dummy") .add(HttpHeaderNames.STATUS, "dummy") .add(HttpHeaderNames.TRANSFER_ENCODING, "dummy") .add(ExtensionHeaderNames.STREAM_ID.text(), "dummy") .add(ExtensionHeaderNames.SCHEME.text(), "dummy") .add(ExtensionHeaderNames.PATH.text(), "dummy") .build(); final io.netty.handler.codec.http.HttpHeaders out = new DefaultHttpHeaders(); toNettyHttp1ServerHeader(in, out); assertThat(out).isEqualTo(new DefaultHttpHeaders() .add(io.netty.handler.codec.http.HttpHeaderNames.TRAILER, "foo") .add(io.netty.handler.codec.http.HttpHeaderNames.HOST, "bar")); }