woltapp / mitmproxy-mock

A tool to mock/modify server responses easily with mitmproxy
MIT License
87 stars 12 forks source link

Remove a call to the non-existing "wrap" method #2

Closed 0neel closed 3 years ago

0neel commented 3 years ago

I was constantly getting the following error in the event log when I tried to substitute a response:

error: Addon error: Traceback (most recent call last):
  File "moxy.py", line 783, in response
    flow.response = make_response(response, flow.response.status_code, flow.response.content, flow.response.headers)
  File "moxy.py", line 484, in make_response
    return http.HTTPResponse.wrap(
AttributeError: type object 'Response' has no attribute 'wrap'

It seems the wrap method was deleted recently according to this commit.

I have no Python development experience but still wanted to share the solution that helped me.

0neel commented 3 years ago

BTW, thanks a lot for moxy. It's really convenient.