lightbody/browsermob-proxy — pull request #26 by afoleypp (2013-09-06 17:45:18+00:00)
Title: Please see Issue 19

Apologies if this is not the right format. Its my first pull request.

Below changes are made with the ability to intercept the response prior to it being served in mind.

Changed classes: BrowserMobHttpClient.java and ClonedOutputStream.

BrowserMobHttpClient:
Moved the check for ResponseInterceptor from execute(BrowserMobHttpRequest req) to execute(BrowserMobHttpRequest req, int dept).
Added code to write from the ClonedOutputStream after interception.

ClonedOutputStream:
Removed the pairing of OutputStream and ByteArrayOutputStream operations, storing in the array until later. This allows us to make a change to the stream before forwarding it.

Notes:
This only works for text code now.

Please send back any feedback or suggestions to me, I havent really worked in this type of area before, so its all learning.

Thanks
Andrew