From 02d3d618204bce2bc0ed088a556a94a8479dcf31 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 16 Oct 2016 23:49:54 -0700 Subject: fix redirect_requests.py example --- examples/redirect_requests.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples/redirect_requests.py') diff --git a/examples/redirect_requests.py b/examples/redirect_requests.py index 8cde1bfd..bbb84e2f 100644 --- a/examples/redirect_requests.py +++ b/examples/redirect_requests.py @@ -11,8 +11,7 @@ def request(flow): # Method 1: Answer with a locally generated response if flow.request.pretty_host.endswith("example.com"): - resp = HTTPResponse.make(200, b"Hello World", {"Content-Type": "text/html"}) - flow.reply.send(resp) + flow.response = HTTPResponse.make(200, b"Hello World", {"Content-Type": "text/html"}) # Method 2: Redirect the request to a different server if flow.request.pretty_host.endswith("example.org"): -- cgit v1.2.3