-
Notifications
You must be signed in to change notification settings - Fork 660
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
Fixed buffer size issue #901
base: master
Are you sure you want to change the base?
Fixed buffer size issue #901
Conversation
@@ -407,7 +407,17 @@ public Reply<?> addResponseFilter(@Named("port") int port, Request<String> reque | |||
String script = getEntityBodyFromRequest(request); | |||
requestResponseFilter.setResponseFilterScript(script); | |||
|
|||
proxy.addResponseFilter(requestResponseFilter); | |||
String bufferSize = request.param("bufferSize"); | |||
if (bufferSize != null && !bufferSize.isEmpty()) { |
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.
Return early instead of conditional checks, and writing repeated code.
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.
Can't return early, because we need to perform some actions depending on this condition.
*/ | ||
@Override | ||
public void addResponseFilterWithCustomBufferSize(ResponseFilter filter, int bufferSize) { | ||
addLastHttpFilterFactory(new ResponseFilterAdapter.FilterSource(filter, bufferSize)); |
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.
What's difference between addLast or addFirst ?
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.
For modifying request we use addFirstHttpFilterFactory
and for modifying response we used addLastHttpFilterFactory
No description provided.