Skip to content

Commit

Permalink
netty (fix): Support reading up to 64kb HTTP header (#3387)
Browse files Browse the repository at this point in the history
  • Loading branch information
xerial authored Feb 19, 2024
1 parent 40d4569 commit a3f21a7
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,15 @@ class NettyServer(config: NettyServerConfig, session: Session) extends HttpServe
val pipeline = ch.pipeline()

// pipeline.addLast(new IdleStateHandler(1, 1, 60, TimeUnit.SECONDS))
pipeline.addLast(new HttpServerCodec()) // 4096, 8192, Int.MaxValue, false))
pipeline.addLast(
new HttpServerCodec(
4096, // the same with Netty's default MAX_INITIAL_LINE_LENGTH
64 * 1024, // Upto ALB's max request header size
// No need to limit the chunk size in Netty. Ref https://github.com/twitter/finagle/commit/990c8650366e5374ea062c753a4628c5971fc40e
Int.MaxValue,
false // Skip header validation
)
)
// pipeline.addLast(new HttpServerKeepAliveHandler())
pipeline.addLast(new HttpObjectAggregator(Int.MaxValue))
pipeline.addLast(new HttpContentCompressor())
Expand Down

0 comments on commit a3f21a7

Please sign in to comment.