Hey guys,
I have an issue, again. x)
Actually, I can only decide if response have to be filtered based on request. If I want to decide to filter or not based on response, I need to embed this conditional code into filterResponse. Even if I want to decide only based in headers.
This wouldn't be ugly if filter didn't need all chunks.
I thought in a shouldFilterResponse that gets responses headers (that comes with the first chunk), and that let we decide it based on those headers.
Then, if we want to decide it by content, we still embed it into filterResponse, wait all chunks to be loaded and filter. In this case this make sense.
But I think that for headers only we can improve it. :)
A real example of this issue is when downloading files. If user is downloading an installer from a filtered site, and we want to filter by response, LittleProxy buffers all the exe|msi and only after all chunks received, it applies the filter and then send it to user. This is really ugly because user don't get any feedback from the browser, that still waiting the page|file by entire download time, and then it downloads.
I hope that I could explain my idea. x)
Cheers,
Caio.