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
Keep headers when Content-Encoding set #7930
Keep headers when Content-Encoding set #7930
Conversation
@@ -13,7 +13,7 @@ private[server] object HttpRequestDecoder { | |||
|
|||
private def decodeRequestWith(decoderFlow: Flow[ByteString, ByteString, NotUsed], request: HttpRequest): HttpRequest = { | |||
request.withEntity(request.entity.transformDataBytes(decoderFlow)) | |||
.withHeaders(request.headers.filter(_.isInstanceOf[`Content-Encoding`])) | |||
.withHeaders(request.headers.filter(!_.isInstanceOf[`Content-Encoding`])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the problem! The condition needs to negated, otherwise we strip out the wrong headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filterNot
?
Fixes playframework#7911. The code now filters out the Content-Encoding header instead of all the other headers when decoding the request content.
0005112
to
2069dd2
Compare
Updated - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Thanks for adding the comments.
Fixes #7911. The code now filters out the Content-Encoding header instead of all the other headers when decoding the request content.
Fixes #7911.
The code now filters out the Content-Encoding header instead of all the other headers when decoding the request content.