davepeck/httreplay — pull request #1 by agriffis (2013-07-30 12:57:37+00:00)
Title: Second batch of changes

Hi Dave, I see you already pulled some of my earlier changes. Thanks! Here's another batch for you:

* The biggest change is a rewrite of ReplayConnectionHelper to implement the lower-level calls (putrequest, putheader, endheaders) rather than retrieve() since not all callers will use that, particularly urllib.urlretrieve() was failing for me.
* Augment filter_query_params() and filter_headers() to accept a list of tuples, where each tuple is a (key, value) pair so that keys can be modified rather than removed. The functions still accept a simple list of keys for backward compatibility. For example I've been using `('secret_key', 'REDACTED')`
* If the response content is text, save it as such in the JSON (without breaking older recordings)
* Add ReplaySettings.allow_network which disallows outbound network requests if set to False.