How to configure max-initial-line-length in Shenyu Gateway?
Question
I am encountering an issue with the default HTTP request line length limit in Shenyu (version 2.6.1). When a request URI exceeds 4096 bytes, I receive the following error:
2024-12-18 13:30:48.761 WARN 14228 --- [nyu-netty-nio-2] r.n.http.server.HttpServerOperations : [d7d12014, L:/127.0.0.1:9195 - R:/127.0.0.1:59507] Decoding failed: FULL_REQUEST(decodeResult: failure(io.netty.handler.codec.http.TooLongHttpLineException: An HTTP line is larger than 4096 bytes.), version: HTTP/1.0, content: UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeHeapByteBuf(ridx: 0, widx: 0, cap: 0))
GET /bad-request HTTP/1.0
I resolved this by modifying Netty's max-initial-line-length parameter using the following configuration in my server settings:
server:
netty:
max-initial-line-length: 409600
However, I couldn't find an equivalent configuration in Shenyu for this parameter. Could you please guide me on how to configure max-initial-line-length in Shenyu or if it's possible to extend this setting via custom configuration or plugin?
Do you mean that adding this configuration parameter in Shenyu is ineffective?
You should add the configuration max-initial-line-length: 409600 to both the bootstrap and downstream services to resolve the issue.