Skip to content

Tags: brunokc/pyProxy

Tags

v0.2.0

Toggle v0.2.0's commit message
Allow for request suppression and custom responses

Callbacks can now suppress requests from being forwarded to the server.
In such cases, the callback is obligated to provide a response to the
client by itself, to close the loop. For that purpose, HttpResponse was
updated to allow it to be modified.

To avoid in the logic, the action taken by the request handling (Forward
or Suppress) is now sent as a parameter to the response callback as well.

Also in this change:

- Bumped version to 0.2.0
- Updated proxy callbacks signature so that responses don't return
  anything and the request action is passed in to inform response handling
- A few more mypy fixes
- Added a few more test tests

v0.1.6

Toggle v0.1.6's commit message
Allow response body to be replaced in the callback

- Bumped version to 0.1.6.
- Expose main classes through __init__.py so client won't need to specify
  submodules.
- Now using const.py. Added a couple of constants to it.
- HttpRequest/HttpResponse: now allowing for the body to be replaced,
  which also updates the content length header. Also, now using more
  technically correct terms and hid some internal variables.
- HttpServer now won't allow loopback addresses as proxy targets, unless
  the new allow_loopback_target options is true (necessary for testing).
  Added new tests to validate that.
- Clean ups throughout