Skip to content

Commit

Permalink
[netty] Broken swagger-ui fix #3433
Browse files Browse the repository at this point in the history
- removing `new FlushConsolidationHandler(DEFAULT_EXPLICIT_FLUSH_AFTER_FLUSHES, false)`
- setting 2nd argument to `true` caused the bug
  • Loading branch information
jknack committed May 22, 2024
1 parent 0530983 commit 4581ece
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/
package io.jooby.internal.netty;

import static io.netty.handler.flush.FlushConsolidationHandler.DEFAULT_EXPLICIT_FLUSH_AFTER_FLUSHES;

import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Supplier;

Expand All @@ -18,7 +16,6 @@
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.*;
import io.netty.handler.codec.http.multipart.HttpDataFactory;
import io.netty.handler.flush.FlushConsolidationHandler;
import io.netty.handler.ssl.SslContext;

public class NettyPipeline extends ChannelInitializer<SocketChannel> {
Expand Down Expand Up @@ -71,7 +68,11 @@ public void initChannel(SocketChannel ch) {
if (sslContext != null) {
p.addLast("ssl", sslContext.newHandler(ch.alloc()));
}
p.addLast(new FlushConsolidationHandler(DEFAULT_EXPLICIT_FLUSH_AFTER_FLUSHES, true));
// https://github.com/jooby-project/jooby/issues/3433:
// using new FlushConsolidationHandler(DEFAULT_EXPLICIT_FLUSH_AFTER_FLUSHES, true)
// cause the bug, for now I'm going to remove flush consolidating handler... doesn't seem to
// help much
// p.addLast(new FlushConsolidationHandler(DEFAULT_EXPLICIT_FLUSH_AFTER_FLUSHES, false));
if (http2) {
var settings = new Http2Settings(maxRequestSize, sslContext != null);
var extension =
Expand Down

0 comments on commit 4581ece

Please sign in to comment.