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 config maxHeaderSize (for the entire HTTP header, defaults to 8192) #512

Closed
caiiiycuk opened this Issue Feb 6, 2015 · 5 comments

Comments

Projects
None yet
3 participants
@caiiiycuk
Contributor

caiiiycuk commented Feb 6, 2015

Hi again!

Search engines (like google or yandex) adds a Referer header to request. Sometimes (in our case) this header can exceed the maximum HTTP header length and in this case server drops the connection. We need way to configure this option (to increase maximum header length).

It will be good if we can configure this options in xitrum.conf, like in play framework:
https://www.playframework.com/documentation/2.3.x/ProductionConfiguration

@caiiiycuk

This comment has been minimized.

Show comment
Hide comment
@caiiiycuk

caiiiycuk Feb 6, 2015

Contributor

UPD: In the link above please goes to "Advanced HTTP server configuration" section.

Contributor

caiiiycuk commented Feb 6, 2015

UPD: In the link above please goes to "Advanced HTTP server configuration" section.

@ngocdaothanh

This comment has been minimized.

Show comment
Hide comment
@ngocdaothanh

ngocdaothanh Feb 6, 2015

Member

@georgeOsdDev Can you take care of this issue?

You need to modify this line:

p.addLast(classOf[HttpRequestDecoder].getName, new HttpRequestDecoder(Config.xitrum.request.maxInitialLineLength, 8192, 8192))

HttpRequestDecoder:
http://netty.io/4.0/api/io/netty/handler/codec/http/HttpRequestDecoder.html

xitrum.conf:
https://github.com/xitrum-framework/xitrum-new/blob/master/config/xitrum.conf#L135

Member

ngocdaothanh commented Feb 6, 2015

@georgeOsdDev Can you take care of this issue?

You need to modify this line:

p.addLast(classOf[HttpRequestDecoder].getName, new HttpRequestDecoder(Config.xitrum.request.maxInitialLineLength, 8192, 8192))

HttpRequestDecoder:
http://netty.io/4.0/api/io/netty/handler/codec/http/HttpRequestDecoder.html

xitrum.conf:
https://github.com/xitrum-framework/xitrum-new/blob/master/config/xitrum.conf#L135

@georgeOsdDev

This comment has been minimized.

Show comment
Hide comment
@georgeOsdDev

georgeOsdDev Feb 6, 2015

Member
The maximum length of all headers. If the sum of the length of each header exceeds this value, a TooLongFrameException will be raised.

When TooLongFrameException(DecoderException) was thrown, it will be caught at BadClientSilencer.
Should we respond 400?

Member

georgeOsdDev commented Feb 6, 2015

The maximum length of all headers. If the sum of the length of each header exceeds this value, a TooLongFrameException will be raised.

When TooLongFrameException(DecoderException) was thrown, it will be caught at BadClientSilencer.
Should we respond 400?

@ngocdaothanh

This comment has been minimized.

Show comment
Hide comment
@ngocdaothanh

ngocdaothanh Feb 6, 2015

Member

Because this exception is thrown from a handler to other handlers in the pipeline, I think it's the only good place where we can catch the exception. I guess there's no better place.

Member

ngocdaothanh commented Feb 6, 2015

Because this exception is thrown from a handler to other handlers in the pipeline, I think it's the only good place where we can catch the exception. I guess there's no better place.

georgeOsdDev added a commit to georgeOsdDev/xitrum that referenced this issue Feb 10, 2015

georgeOsdDev added a commit to georgeOsdDev/xitrum that referenced this issue Feb 10, 2015

ngocdaothanh added a commit that referenced this issue Feb 10, 2015

Merge pull request #513 from georgeOsdDev/patch/netty_config
PR for #512 Feature request: needed more control over netty configuratio...

@ngocdaothanh ngocdaothanh changed the title from Feature request: needed more control over netty configuration to Add config maxHeaderSize (maximum size for the entire HTTP header, defaults to 8192) Feb 10, 2015

@ngocdaothanh ngocdaothanh changed the title from Add config maxHeaderSize (maximum size for the entire HTTP header, defaults to 8192) to Add config maxHeaderSize (for the entire HTTP header, defaults to 8192) Feb 10, 2015

@ngocdaothanh

This comment has been minimized.

Show comment
Hide comment
@ngocdaothanh
Member

ngocdaothanh commented Mar 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment