# Understanding 0.18.2 redirect\_requests example script

**URL:** <https://discourse.mitmproxy.org/t/understanding-0-18-2-redirect-requests-example-script/296>\
**Category:** help\
**Created:** [January 7, 2017, 7:33pm UTC](https://discourse.mitmproxy.org/t/understanding-0-18-2-redirect-requests-example-script/296 "2017-01-07T19:33:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ironhokie](https://avatars.discourse-cdn.com/v4/letter/i/67e7ee/32.png) [@ironhokie](https://discourse.mitmproxy.org/u/ironhokie)\
**Post date:** [January 7, 2017, 7:33pm UTC](https://discourse.mitmproxy.org/t/understanding-0-18-2-redirect-requests-example-script/296/1 "2017-01-07T19:33:34Z")

</div>

I’m using mitmproxy0.18.2 w/Python3.5.2, with a pretty complex input script. Everything works great, except for an issue generating responses to particular requests. I tore it down to the basic example ([https://github.com/mitmproxy/mitmproxy/blob/0.18.x/examples/redirect\_requests.py](https://github.com/mitmproxy/mitmproxy/blob/0.18.x/examples/redirect_requests.py)).

Run curl:  
curl -x 127.0.0.1:8080 [example.com](http://example.com)

Run mitmdump:  
/opt/my0.18# mitmdump -s redirect\_requests.py  
127.0.0.1:42475: GET [http://example.com/](http://example.com/)  
\<\< 200 OK 1.24k  
127.0.0.1:42475: clientdisconnect

You can see that I get the full 1.24kb of content from [example.com](http://example.com), when I expect to get “Hello world.” Am I misunderstanding what’s supposed to happen here?

---

<div class="post-metadata">

**Author:** ![mhils](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/mhils/32/7_2.png) [@mhils](https://discourse.mitmproxy.org/u/mhils)\
**Post date:** [January 7, 2017, 8:09pm UTC](https://discourse.mitmproxy.org/t/understanding-0-18-2-redirect-requests-example-script/296/2 "2017-01-07T20:09:17Z")

</div>

> You can see that I get the full 1.24kb of content from [example.com](http://example.com), when I expect to get “Hello world.” Am I misunderstanding what’s supposed to happen here?

No - this looks like wrong behaviour. `examples/simple/send_reply_from_proxy.py` works fine for me with 1.0.2. Can you upgrade to 1.0 and try again?
