-
Notifications
You must be signed in to change notification settings - Fork 19
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
Stop double encoding body when we have a response encoder #550
Conversation
When a response-encoder is present, it handles encoding the response. Without this change, we were then falling through and encoding the body into the response a second time. This was discovered in AWS here micronaut-projects/micronaut-aws#1843 It wasn't seen here as we add a servlet for handling static resources in jetty/undertow/tomcat
Can this be tested? |
@dstepanov Trying to think of a way to test it, but struggling atm... 🤔 |
@dstepanov As far as I can tell, tomcat/jetty/undertow take the async path. It's only when we get to AWS or GCP that the synch path is taken and this bug is exhibited 🤔 |
Maybe we can force the servlet engine to always use sync |
@dstepanov Can do something like this: So use a "secret" property to switch to sync mode (but default to async mode) Or should this be a public config? |
Kudos, SonarCloud Quality Gate passed! |
The secret property is fine with me. I thought a servlet engine like Jetty would have an internal option to disable async, but it might be part of the spec, so probably not. |
ping @dstepanov |
When a response-encoder is present, it handles encoding the response.
Without this change, we were then falling through and encoding the body into the response a second time.
This was discovered in AWS here micronaut-projects/micronaut-aws#1843
It wasn't seen here as we add a servlet for handling static resources in jetty/undertow/tomcat