Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for configuring Netty's request decoding limits (initial line length, header size, and chunk size) #9955

Closed
PKUliwp opened this issue Aug 4, 2017 · 4 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@PKUliwp
Copy link

PKUliwp commented Aug 4, 2017

I use reactor netty in my spring boot project. I get 404 when I request a long URI (request header is about 5KB, <8KB), like this:

http://myhost/live/filter?ids=...&a=...&b=..&c=...

I reproduce this error in this very simple project. You can find it:

https://github.com/PKUliwp/URI-test

I try to use jetty and undertow, and they are ok for same request. But I still want to use netty. I think there is a way to config this property, though I find nothing from reference. I want to know how to config the embedded netty to let my server work when it meets long URI.

@wilkinsona
Copy link
Member

wilkinsona commented Aug 4, 2017

Thanks for the sample. Improving this will require an enhancement to Reactor Netty. To that end I've opened reactor/reactor-netty#150.

I've tentatively scheduled this for M5, but we're reliant on the Reactor Netty enhancement being available.

@wilkinsona wilkinsona added priority: high status: blocked An issue that's blocked on an external project change type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 4, 2017
@wilkinsona wilkinsona added this to the 2.0.0.M5 milestone Aug 4, 2017
@wilkinsona wilkinsona changed the title Embedded NettyWebServer can't response correctly when URI is too long Add support for configuring Netty's request decoding limits (initial line length, header size, and chunk size) Aug 4, 2017
@philwebb philwebb modified the milestones: 2.0.0.M5, 2.0.0.RC1, 2.0.0.M6 Sep 20, 2017
@wilkinsona
Copy link
Member

The underlying Reactor Netty issue has not yet been fixed so this needs to be pushed back.

@wilkinsona wilkinsona modified the milestones: 2.0.0.M6, 2.0.0.RC1 Oct 30, 2017
@philwebb philwebb modified the milestones: 2.0.0.M7, 2.0.0.RC1 Nov 8, 2017
@wilkinsona wilkinsona self-assigned this Jan 4, 2018
@wilkinsona wilkinsona removed the status: blocked An issue that's blocked on an external project change label Jan 4, 2018
@philwebb philwebb added the status: blocked An issue that's blocked on an external project change label Jan 17, 2018
@wilkinsona wilkinsona removed the status: blocked An issue that's blocked on an external project change label Jan 24, 2018
@philwebb
Copy link
Member

Looks like this was backported to 0.7 reactor/reactor-netty#263

@wilkinsona wilkinsona assigned bclozel and unassigned wilkinsona Jan 24, 2018
@bclozel
Copy link
Member

bclozel commented Jan 25, 2018

We've added a NettyServerCustomizer interface in #10418.
Since new options were added on Reactor Netty's HttpServerOptions.Builder, you can use this infrastructure to change those options.

Here's an example:

@Configuration
public class ServerConfiguration {
	
  @Bean
  public NettyServerCustomizer serverCustomizer() {
    return options -> options.maxInitialLineLength(LINE_LENGTH).initialBufferSize(BUFFER_SIZE);
  }
}

Spring Boot 2.0.RC1 depends on Reactor Netty 0.7.3, which contains those changes. No further changes are required in Spring Boot for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants