Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sourabhgomebs
Copy link

No description provided.

@@ -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()) {

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.

Copy link
Author

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));

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 ?

Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants