micronaut-projects / micronaut-core

Micronaut Application Framework
http://micronaut.io
Apache License 2.0
6.05k stars 1.06k 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 11 months ago

pending new body api

sdelamo commented 8 months ago

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

yawkat commented 8 months ago

no