diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-06-07 16:11:32 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-06-07 16:11:32 +1200 |
commit | df962f8e7bab9d8cd1dc9143f44977b0711c5bd9 (patch) | |
tree | 3e949abaad30590c0c822c0293ae0fd494ff1c2a /libpathod/pathod.py | |
parent | 0da3e51e1c08eed2c8054d4a71bc591268b19af1 (diff) | |
download | mitmproxy-df962f8e7bab9d8cd1dc9143f44977b0711c5bd9.tar.gz mitmproxy-df962f8e7bab9d8cd1dc9143f44977b0711c5bd9.tar.bz2 mitmproxy-df962f8e7bab9d8cd1dc9143f44977b0711c5bd9.zip |
Convert parse_pathod to generator
Diffstat (limited to 'libpathod/pathod.py')
-rw-r--r-- | libpathod/pathod.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libpathod/pathod.py b/libpathod/pathod.py index 367a3163..a5e6b8fa 100644 --- a/libpathod/pathod.py +++ b/libpathod/pathod.py @@ -295,17 +295,17 @@ class PathodHandler(tcp.BaseHandler): anchor_spec = language.parse_pathod(spec) except language.ParseException as v: lg("Parse error: %s" % v.msg) - anchor_spec = language.http.make_error_response( + anchor_spec = iter([language.http.make_error_response( "Parse Error", "Error parsing response spec: %s\n" % ( v.msg + v.marked() ) - ) + )]) if anchor_spec: lg("crafting spec: %s" % anchor_spec) nexthandler, retlog["response"] = self.http_serve_crafted( - anchor_spec + anchor_spec.next() ) if nexthandler and websocket_key: return self.handle_websocket, retlog |