File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
reactor-netty-http/src/main/java/reactor/netty/http Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2020-2022 VMware, Inc. or its affiliates, All Rights Reserved.
2+ * Copyright (c) 2020-2025 VMware, Inc. or its affiliates, All Rights Reserved.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2020import io .netty .channel .ChannelHandler ;
2121import io .netty .channel .ChannelHandlerContext ;
2222import io .netty .channel .ChannelPromise ;
23- import io .netty .handler .codec .http . DefaultHttpContent ;
23+ import io .netty .handler .codec .http2 . DefaultHttp2DataFrame ;
2424import io .netty .handler .codec .http2 .Http2StreamFrameToHttpObjectCodec ;
2525
2626/**
@@ -44,7 +44,8 @@ public void channelActive(ChannelHandlerContext ctx) {
4444 public void write (ChannelHandlerContext ctx , Object msg , ChannelPromise promise ) {
4545 if (msg instanceof ByteBuf ) {
4646 //"FutureReturnValueIgnored" this is deliberate
47- ctx .write (new DefaultHttpContent ((ByteBuf ) msg ), promise );
47+ //This will skip Http2StreamFrameToHttpObjectCodec as there is no need of any extra handling
48+ ctx .write (new DefaultHttp2DataFrame ((ByteBuf ) msg , false ), promise );
4849 }
4950 else {
5051 //"FutureReturnValueIgnored" this is deliberate
Original file line number Diff line number Diff line change 2828import io .netty .channel .ChannelPromise ;
2929import io .netty .handler .codec .DecoderResult ;
3030import io .netty .handler .codec .http .DefaultFullHttpResponse ;
31- import io .netty .handler .codec .http .DefaultHttpContent ;
3231import io .netty .handler .codec .http .DefaultHttpResponse ;
3332import io .netty .handler .codec .http .DefaultLastHttpContent ;
3433import io .netty .handler .codec .http .HttpObject ;
3938import io .netty .handler .codec .http .LastHttpContent ;
4039import io .netty .handler .codec .http .cookie .ServerCookieDecoder ;
4140import io .netty .handler .codec .http .cookie .ServerCookieEncoder ;
41+ import io .netty .handler .codec .http2 .DefaultHttp2DataFrame ;
4242import io .netty .handler .codec .http2 .Http2StreamFrameToHttpObjectCodec ;
4343import io .netty .handler .ssl .SslHandler ;
4444import io .netty .util .ReferenceCountUtil ;
@@ -224,7 +224,8 @@ else if (msg instanceof ByteBuf) {
224224 }
225225
226226 //"FutureReturnValueIgnored" this is deliberate
227- ctx .write (new DefaultHttpContent ((ByteBuf ) msg ), promise );
227+ //This will skip Http2StreamFrameToHttpObjectCodec as there is no need of any extra handling
228+ ctx .write (new DefaultHttp2DataFrame ((ByteBuf ) msg , false ), promise );
228229 }
229230 else if (msg instanceof HttpResponse && HttpResponseStatus .CONTINUE .code () == ((HttpResponse ) msg ).status ().code ()) {
230231 //"FutureReturnValueIgnored" this is deliberate
You can’t perform that action at this time.
0 commit comments