Skip to content

Fixed buffer size issue#901

Open
sourabhgomebs wants to merge 1 commit intolightbody:masterfrom
sourabhgomebs:browsermob-proxy-2.1.5-buffer-size-fix
Open

Fixed buffer size issue#901
sourabhgomebs wants to merge 1 commit intolightbody:masterfrom
sourabhgomebs:browsermob-proxy-2.1.5-buffer-size-fix

Conversation

@sourabhgomebs
Copy link
Copy Markdown

No description provided.


proxy.addResponseFilter(requestResponseFilter);
String bufferSize = request.param("bufferSize");
if (bufferSize != null && !bufferSize.isEmpty()) {
Copy link
Copy Markdown

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
Copy Markdown
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));
Copy link
Copy Markdown

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
Copy Markdown
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