micronaut-projects / micronaut-core

Micronaut Application Framework
http://micronaut.io
Apache License 2.0
6.09k stars 1.07k forks source link

Cannot use client.proxy inside a ServerFilter with Servlets #9725

Open timyates opened 1 year ago

timyates commented 1 year ago

In https://github.com/micronaut-projects/micronaut-core/pull/9724 we added a server TCK test for rewriting the request URI as shown in the documentation here https://docs.micronaut.io/latest/guide/#proxyClient

This works fine with Netty based servers.

However with Servlet based servers we end up with a NettyStreamedHttpResponse for the proxied request. This has a null body, and so we end up with an empty response to proxied request.

NettyStreamedHttpResponse is a package private class, so there's no way of detecting or interacting with it in ServletHttpHandler.encodeResponse where I believe the body should be somehow passed across

This was discovered when verifying this issue in servlet https://github.com/micronaut-projects/micronaut-servlet/issues/262

yawkat commented 1 year ago

pending new body api

sdelamo commented 9 months ago

@yawkat do we have this "new body api"?

yawkat commented 9 months ago

no