Skip to content

Ensure HttpServer minCompressionSize is respected when Content-Length is not explicit and response is Mono#2646

Merged
violetagg merged 1 commit into1.0.xfrom
compression-below-specified-size
Jan 11, 2023
Merged

Ensure HttpServer minCompressionSize is respected when Content-Length is not explicit and response is Mono#2646
violetagg merged 1 commit into1.0.xfrom
compression-below-specified-size

Conversation

@violetagg
Copy link
Copy Markdown
Member

When a Mono is sent as a response or a single ByteBuf is sent as a response, Reactor Netty will send FullHttpResponse and thus is able to set Content-Length if such is not already set. Based on the Content-Length, Reactor Netty can decide whether or not a compression is needed.

… is not explicit and response is Mono

When a Mono is sent as a response or a single ByteBuf is sent as a response,
Reactor Netty will send FullHttpResponse and thus is able to set Content-Length if such is not already set.
Based on the Content-Length, Reactor Netty can decide whether or not a compression is needed.
@violetagg violetagg added the type/bug A general bug label Jan 11, 2023
@violetagg violetagg added this to the 1.0.28 milestone Jan 11, 2023
@violetagg violetagg requested a review from a team January 11, 2023 08:54
@violetagg
Copy link
Copy Markdown
Member Author

@reactor/netty-team PTAL

Copy link
Copy Markdown
Contributor

@pderop pderop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I see ... it is the newFullBodyMessage which is setting the Content-Length header, so the newFullBodyMessage method must be called prior to afterMarkSentHeaders() call.

LGTM

@violetagg
Copy link
Copy Markdown
Member Author

@pderop Thanks for the review!

@violetagg violetagg merged commit 1b61318 into 1.0.x Jan 11, 2023
@violetagg violetagg deleted the compression-below-specified-size branch January 11, 2023 09:44
violetagg added a commit that referenced this pull request Jan 11, 2023
violetagg added a commit that referenced this pull request Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants