-
Notifications
You must be signed in to change notification settings - Fork 107
Enhance the MultiReadHttpServletRequest stream #721
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
base: main
Are you sure you want to change the base?
Conversation
Typo in commit message. MultiReadHttpServletReques |
@Override | ||
public int read(byte[] b, int off, int len) |
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 we also implement public int read(byte[] b)
?
public int read(byte[] b, int off, int len) | ||
throws IOException | ||
{ | ||
return byteArrayInputStream.read(b, off, len); |
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.
do we want to make this null-safe?
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.
byteArrayInputStream is locally allocated, if that's what your concern is. It should not be null.
Is this good to to @vishalya @Chaho12 @oneonestar ? |
Seems ok. But don't forget to fix the commit message :) |
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.
LGTM except for the commit msg
Description
MultiReadHttpServletRequest class returns the stream with the cached body of the request. But the overriden methods logic look wrong. Also giving an option to multiple bytes for better performance.
Additional context and related issues
@Chaho12 has idea on the issue with this code. @willmostly is the original author.
Release notes
(X) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required, with the following suggested text: