-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Extract Netty specific RequestFilter TCK test #9387
Conversation
This test requires FullBodyRequest support which doesn't exist in Servlet. Introduced here #9353 To avoid having to exclude all of the Request Filter tests from the Servlet TCK, we have extracted this single test into it's own specification. See micronaut-projects/micronaut-servlet#470 for discussion.
Kudos, SonarCloud Quality Gate passed! |
what does it mean to be a |
that the full body is immediately available for reading |
I guess the more correct fix is to implement the required parts of #9353 in Servlet, so the full TCK passes there too... |
the test doesn't even work all the time in netty, it's best effort. if you used a larger body it would fail. (unless you enable FULL_CONTENT mode, which the test doesn't) |
don't think we should do this, this interface should be simply to implement in servlet |
extracting the test is probably fine tho |
@graemerocher i dont see a sensible way to implement it though |
servlet exposes |
actually I think resetting the input stream will probably not work, it would need to be implemented as a wrapper, and cache the bytes a bit like https://github.com/spring-projects/spring-framework/blob/main/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java |
it would essentially require something like full_content though. we can't risk blocking in the body annotation binder, so we can't block in FullHttpRequest.contents |
a servlet container is not like Netty and always has the full content available from the request |
not always, the stream is still lazy |
the way you toggle that off and on is by enabling/disabling async request processing. This would be the equivalent of |
the body is not necessarily fully present no matter whether youre using async mode or not in the servlet. |
how so? It is available via |
but reading the stream may block while the netty implementation never will. theres no api to know whether it will block or not |
if you disable asynchronous request processing you already assume the code that is going to be executed is blocking |
I got this together as a POC Not sure it's right... PTAL: micronaut-projects/micronaut-servlet#471 |
Closing this now, as it's superseded by micronaut-projects/micronaut-servlet#471 |
This test requires FullBodyRequest support which doesn't exist in Servlet.
Introduced here #9353
To avoid having to exclude all of the Request Filter tests from the Servlet TCK, we have extracted this single test into it's own specification.
See micronaut-projects/micronaut-servlet#470 for discussion.