-
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
wip: Attempt to get FullHttpRequest support in Servlet requests #471
Conversation
@Override | ||
public ByteBuffer<?> contents() { | ||
if (bodyIsReadAsync) { | ||
throw new IllegalStateException("Cannot fetch body content of an asynchronous request"); |
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.
should return null on failure (bufferContents should error though)
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.
Like this? 0bc7ca8
public ExecutionFlow<ByteBuffer<?>> bufferContents() { | ||
ByteBuffer<?> contents = contents(); | ||
if (contents == null) { | ||
throw new IllegalStateException("Cannot buffer contents asynchronously"); |
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.
i changed my mind on this, please return null in this case (null, not ExecutionFlow.just(null)). I will adjust the supermethod in core accordingly.
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.
throw new IllegalStateException("Cannot buffer contents asynchronously"); | |
return null; |
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.
servlet-engine/src/main/java/io/micronaut/servlet/engine/DefaultServletHttpRequest.java
Outdated
Show resolved
Hide resolved
return ExecutionFlow.just(contents); | ||
} | ||
|
||
private final class ServletByteBuffer<T> implements ByteBuffer<T> { |
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.
should not we move this class to servlet-core
so that we are able to use it in the serverless implementations?
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.
Maybe extract it into its own file and annotate it with @Experimental
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.
Done in 1bb046f
Which isn't showing up in the PR for unknown reasons... github status is lying I suspect
SonarCloud Quality Gate failed. |
No description provided.